﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.stmt;
using SharpSqlAnalyzer.stmt.mssql;
using SharpSqlAnalyzer.stmt.oracle;
using SharpSqlAnalyzer.stmt.teradata;

namespace SharpSqlAnalyzer
{
	// Token: 0x02000047 RID: 71
	[CLSCompliant(true)]
	public class TGSharpSqlParser
	{
		// Token: 0x17000016 RID: 22
		// (get) Token: 0x06000092 RID: 146 RVA: 0x00006978 File Offset: 0x00004B78
		// (set) Token: 0x06000091 RID: 145 RVA: 0x0000695D File Offset: 0x00004B5D
		public virtual string sqltext
		{
			get
			{
				return this._sqltext;
			}
			set
			{
				this._sqltext = value;
				this._sqlfilename = "";
				this.sqlInputStream = null;
			}
		}

		// Token: 0x17000017 RID: 23
		// (get) Token: 0x06000094 RID: 148 RVA: 0x0000699B File Offset: 0x00004B9B
		// (set) Token: 0x06000093 RID: 147 RVA: 0x00006980 File Offset: 0x00004B80
		public virtual string sqlfilename
		{
			get
			{
				return this._sqlfilename;
			}
			set
			{
				this._sqlfilename = value;
				this._sqltext = "";
				this.sqlInputStream = null;
			}
		}

		// Token: 0x17000018 RID: 24
		// (get) Token: 0x06000096 RID: 150 RVA: 0x000069C2 File Offset: 0x00004BC2
		// (set) Token: 0x06000095 RID: 149 RVA: 0x000069A3 File Offset: 0x00004BA3
		public virtual Stream SqlInputStream
		{
			get
			{
				return this.sqlInputStream;
			}
			set
			{
				this.sqlInputStream = value;
				this._sqlfilename = "";
				this._sqltext = "";
			}
		}

		// Token: 0x17000019 RID: 25
		// (get) Token: 0x06000097 RID: 151 RVA: 0x000069CA File Offset: 0x00004BCA
		// (set) Token: 0x06000098 RID: 152 RVA: 0x000069D2 File Offset: 0x00004BD2
		public virtual TSourceTokenList sourcetokenlist
		{
			get
			{
				return this._sourcetokenlist;
			}
			set
			{
				this._sourcetokenlist = value;
			}
		}

		// Token: 0x1700001A RID: 26
		// (get) Token: 0x06000099 RID: 153 RVA: 0x000069DB File Offset: 0x00004BDB
		// (set) Token: 0x0600009A RID: 154 RVA: 0x000069E3 File Offset: 0x00004BE3
		public virtual TStatementList sqlstatements
		{
			get
			{
				return this._sqlstatements;
			}
			set
			{
				this._sqlstatements = value;
			}
		}

		// Token: 0x1700001B RID: 27
		// (get) Token: 0x0600009B RID: 155 RVA: 0x000069EC File Offset: 0x00004BEC
		public virtual List<TSyntaxError> SyntaxErrors
		{
			get
			{
				return this.syntaxErrors;
			}
		}

		// Token: 0x1700001C RID: 28
		// (get) Token: 0x0600009C RID: 156 RVA: 0x000069F4 File Offset: 0x00004BF4
		public virtual EDbVendor DbVendor
		{
			get
			{
				return this.dbVendor;
			}
		}

		// Token: 0x1700001D RID: 29
		// (get) Token: 0x0600009E RID: 158 RVA: 0x00006A05 File Offset: 0x00004C05
		// (set) Token: 0x0600009D RID: 157 RVA: 0x000069FC File Offset: 0x00004BFC
		public bool EnablePartialParsing
		{
			get
			{
				return this.enablePartialParsing;
			}
			set
			{
				this.enablePartialParsing = value;
			}
		}

		// Token: 0x1700001E RID: 30
		// (get) Token: 0x0600009F RID: 159 RVA: 0x00006A0D File Offset: 0x00004C0D
		private static string UserName
		{
			get
			{
				return TGSharpSqlParser.userName;
			}
		}

		// Token: 0x1700001F RID: 31
		// (get) Token: 0x060000A0 RID: 160 RVA: 0x00006A14 File Offset: 0x00004C14
		private static string MachineId
		{
			get
			{
				return TGSharpSqlParser.machineId;
			}
		}

		// Token: 0x17000020 RID: 32
		// (get) Token: 0x060000A1 RID: 161 RVA: 0x00006A1B File Offset: 0x00004C1B
		private static string LicenseMessage
		{
			get
			{
				return TGSharpSqlParser.licenseMessage;
			}
		}

		// Token: 0x060000A2 RID: 162 RVA: 0x00006A22 File Offset: 0x00004C22
		static TGSharpSqlParser()
		{
			TGSharpSqlParser.licenseOK = TGSharpSqlParser.validateLicense();
		}

		// Token: 0x17000021 RID: 33
		// (get) Token: 0x060000A3 RID: 163 RVA: 0x00006A44 File Offset: 0x00004C44
		private static string LicenseType
		{
			get
			{
				return TGSharpSqlParser.licenseType;
			}
		}

		// Token: 0x17000022 RID: 34
		// (get) Token: 0x060000A4 RID: 164 RVA: 0x00006A4B File Offset: 0x00004C4B
		public TCustomLexer Flexer
		{
			get
			{
				return this.flexer;
			}
		}

		// Token: 0x17000023 RID: 35
		// (set) Token: 0x060000A5 RID: 165 RVA: 0x00006A53 File Offset: 0x00004C53
		public ITokenHandle TokenHandle
		{
			set
			{
				this.tokenHandle = value;
			}
		}

		// Token: 0x17000024 RID: 36
		// (get) Token: 0x060000A7 RID: 167 RVA: 0x00006A65 File Offset: 0x00004C65
		// (set) Token: 0x060000A6 RID: 166 RVA: 0x00006A5C File Offset: 0x00004C5C
		public virtual IMetaDatabase MetaDatabase
		{
			get
			{
				return this.metaDatabase;
			}
			set
			{
				this.metaDatabase = value;
			}
		}

		// Token: 0x060000A8 RID: 168 RVA: 0x00006A6D File Offset: 0x00004C6D
		private void freeParseTable()
		{
			this.flexer.yystack = null;
			this.flexer.yytextbuf = null;
			this.flexer.buf = null;
		}

		// Token: 0x060000A9 RID: 169 RVA: 0x00006A94 File Offset: 0x00004C94
		public TGSharpSqlParser(EDbVendor pdbvendor)
		{
			this.dbVendor = pdbvendor;
			this._sqltext = "";
			this._sqlfilename = "";
			this.delimiterchar = ';';
			this.defaultDelimiterStr = ";";
			switch (pdbvendor)
			{
			case EDbVendor.dbvaccess:
				this.flexer = new TLexerMssql();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserMssqlSql(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvdb2:
				this.delimiterchar = '@';
				this.flexer = new TLexerDb2();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserDb2Sql(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvgreenplum:
				this.delimiterchar = '/';
				this.flexer = new TLexerGreenplum();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserGreenplum(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvhive:
				this.delimiterchar = ';';
				this.flexer = new TLexerHive();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserHive(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvimpala:
				this.delimiterchar = ';';
				this.flexer = new TLexerImpala();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserImpala(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvinformix:
				this.flexer = new TLexerInformix();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserInformix(null);
				this.fparser.lexer = this.flexer;
				this.enablePartialParsing = false;
				goto IL_6A2;
			case EDbVendor.dbvmdx:
				this.delimiterchar = ';';
				this.flexer = new TLexerMdx();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserMdx(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvmysql:
				this.delimiterchar = '$';
				this.defaultDelimiterStr = "$";
				this.flexer = new TLexerMysql();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserMysqlSql(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvmssql:
				this.flexer = new TLexerMssql();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserMssqlSql(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvnetezza:
				this.delimiterchar = ';';
				this.flexer = new TLexerNetezza();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserNetezza(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvoracle:
				this.delimiterchar = '/';
				this.flexer = new TLexerOracle();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserOracleSql(null);
				this.fplsqlparser = new TParserOraclePLSql(null);
				this.fparser.lexer = this.flexer;
				this.fplsqlparser.lexer = this.flexer;
				this.fplsqlparser.NodeFactory.GSharpSqlParser = this;
				goto IL_6A2;
			case EDbVendor.dbvpostgresql:
				this.delimiterchar = '/';
				this.flexer = new TLexerPostgresql();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserPostgresql(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvredshift:
				this.delimiterchar = '/';
				this.flexer = new TLexerRedshift();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserRedshift(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvsybase:
				this.flexer = new TLexerSybase();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserSybase(null);
				this.fparser.lexer = this.flexer;
				this.enablePartialParsing = false;
				goto IL_6A2;
			case EDbVendor.dbvteradata:
				this.delimiterchar = '/';
				this.flexer = new TLexerTeradata();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserTeradata(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvsnowflake:
				this.delimiterchar = ';';
				this.flexer = new TLexerSnowflake();
				this.flexer.delimiterchar = this.delimiterchar;
				this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
				this.fparser = new TParserSnowflake(null);
				this.fparser.lexer = this.flexer;
				goto IL_6A2;
			case EDbVendor.dbvbigquery:
				this.flexer = null;
				this.fparser = null;
				goto IL_6A2;
			case EDbVendor.dbvhana:
				this.flexer = null;
				this.fparser = null;
				goto IL_6A2;
			}
			this.flexer = new TLexerMssql();
			this.flexer.delimiterchar = this.delimiterchar;
			this.flexer.defaultDelimiterStr = this.defaultDelimiterStr;
			this.fparser = new TParserMssqlSql(null);
			this.fparser.lexer = this.flexer;
			IL_6A2:
			this.fparser.NodeFactory.GSharpSqlParser = this;
			this.sourcetokenlist = new TSourceTokenList();
			this.sqlstatements = new TStatementList();
			this.sqlcmds = new TSqlCmds();
			this.syntaxErrors = new List<TSyntaxError>();
			this.errormessage = "";
		}

		// Token: 0x060000AA RID: 170 RVA: 0x0000718C File Offset: 0x0000538C
		public static TSelectSqlStatement parseSubquery(EDbVendor dbVendor, string subquery)
		{
			TGSharpSqlParser tGSharpSqlParser = new TGSharpSqlParser(dbVendor);
			tGSharpSqlParser.sqltext = subquery;
			if (tGSharpSqlParser.doparse() != 0)
			{
				return null;
			}
			return (TSelectSqlStatement)tGSharpSqlParser.sqlstatements.get(0);
		}

		// Token: 0x060000AB RID: 171 RVA: 0x000071C2 File Offset: 0x000053C2
		public virtual TSelectSqlStatement parseSubquery(string subquery)
		{
			return TGSharpSqlParser.parseSubquery(this.dbVendor, subquery);
		}

		// Token: 0x060000AC RID: 172 RVA: 0x000071D0 File Offset: 0x000053D0
		public static TExpression parseExpression(EDbVendor dbVendor, string expr)
		{
			TGSharpSqlParser tGSharpSqlParser = new TGSharpSqlParser(dbVendor);
			tGSharpSqlParser.sqltext = "select 1 from t where " + TBaseType.newline + expr;
			if (tGSharpSqlParser.doparse() != 0)
			{
				return null;
			}
			return ((TSelectSqlStatement)tGSharpSqlParser.sqlstatements.get(0)).WhereClause.Condition;
		}

		// Token: 0x060000AD RID: 173 RVA: 0x0000721F File Offset: 0x0000541F
		public virtual TExpression parseExpression(string expr)
		{
			return TGSharpSqlParser.parseExpression(this.dbVendor, expr);
		}

		// Token: 0x060000AE RID: 174 RVA: 0x0000722D File Offset: 0x0000542D
		public virtual TFunctionCall parseFunctionCall(string newFunction)
		{
			return TGSharpSqlParser.parseFunctionCall(this.dbVendor, newFunction);
		}

		// Token: 0x060000AF RID: 175 RVA: 0x0000723C File Offset: 0x0000543C
		public static TFunctionCall parseFunctionCall(EDbVendor dbVendor, string newFunction)
		{
			TGSharpSqlParser tGSharpSqlParser = new TGSharpSqlParser(dbVendor);
			tGSharpSqlParser.sqltext = string.Concat(new string[]
			{
				"select",
				TBaseType.newline,
				newFunction,
				TBaseType.newline,
				"from t"
			});
			if (tGSharpSqlParser.doparse() != 0)
			{
				return null;
			}
			return ((TSelectSqlStatement)tGSharpSqlParser.sqlstatements.get(0)).ResultColumnList.getResultColumn(0).Expr.FunctionCall;
		}

		// Token: 0x060000B0 RID: 176 RVA: 0x000072B5 File Offset: 0x000054B5
		public virtual TObjectName parseObjectName(string newObjectName)
		{
			return TGSharpSqlParser.parseObjectName(this.dbVendor, newObjectName);
		}

		// Token: 0x060000B1 RID: 177 RVA: 0x000072C4 File Offset: 0x000054C4
		public static TObjectName parseObjectName(EDbVendor dbVendor, string newObjectName)
		{
			TGSharpSqlParser tGSharpSqlParser = new TGSharpSqlParser(dbVendor);
			tGSharpSqlParser.sqltext = string.Concat(new string[]
			{
				"select",
				TBaseType.newline,
				newObjectName,
				TBaseType.newline,
				"from t"
			});
			if (tGSharpSqlParser.doparse() != 0)
			{
				return null;
			}
			return ((TSelectSqlStatement)tGSharpSqlParser.sqlstatements.get(0)).ResultColumnList.getResultColumn(0).Expr.ObjectOperand;
		}

		// Token: 0x060000B2 RID: 178 RVA: 0x00007340 File Offset: 0x00005540
		public TConstant parseConstant(string newConstant)
		{
			TGSharpSqlParser tGSharpSqlParser = new TGSharpSqlParser(this.dbVendor);
			tGSharpSqlParser.sqltext = string.Concat(new string[]
			{
				"select",
				TBaseType.newline,
				newConstant,
				TBaseType.newline,
				"from t"
			});
			if (tGSharpSqlParser.doparse() != 0)
			{
				return null;
			}
			return ((TSelectSqlStatement)tGSharpSqlParser.sqlstatements.get(0)).ResultColumnList.getResultColumn(0).Expr.ConstantOperand;
		}

		// Token: 0x17000025 RID: 37
		// (get) Token: 0x060000B3 RID: 179 RVA: 0x000073BE File Offset: 0x000055BE
		public virtual int ErrorCount
		{
			get
			{
				return this.syntaxErrors.Count;
			}
		}

		// Token: 0x17000026 RID: 38
		// (get) Token: 0x060000B4 RID: 180 RVA: 0x000073CC File Offset: 0x000055CC
		public virtual string Errormessage
		{
			get
			{
				string text = "";
				string text2 = "Syntax error";
				for (int i = 0; i < this.syntaxErrors.Count; i++)
				{
					TSyntaxError tsyntaxError = this.syntaxErrors[i];
					if (tsyntaxError.hint.Length > 0)
					{
						text2 = tsyntaxError.hint;
					}
					text = string.Concat(new string[]
					{
						text,
						text2,
						"(",
						tsyntaxError.errorno.ToString(),
						") near: ",
						tsyntaxError.tokentext
					});
					text = text + "(" + tsyntaxError.lineNo.ToString();
					text = text + "," + tsyntaxError.columnNo.ToString() + ")";
					if (i != this.syntaxErrors.Count - 1)
					{
						text += TBaseType.linebreak;
					}
				}
				if (this.errormessage.Length > 0)
				{
					text = this.errormessage + TBaseType.linebreak + text;
				}
				return text;
			}
		}

		// Token: 0x060000B5 RID: 181 RVA: 0x000074CE File Offset: 0x000056CE
		public virtual int checkSyntax()
		{
			return this.doparse();
		}

		// Token: 0x060000B6 RID: 182 RVA: 0x000074D6 File Offset: 0x000056D6
		public virtual int parse()
		{
			return this.doparse();
		}

		// Token: 0x060000B7 RID: 183 RVA: 0x000074DE File Offset: 0x000056DE
		internal virtual void setdelimiterchar(char ch)
		{
			this.delimiterchar = ch;
			this.flexer.delimiterchar = ch;
		}

		// Token: 0x060000B8 RID: 184 RVA: 0x000074F4 File Offset: 0x000056F4
		internal virtual bool includesqlstatementtype(ESqlStatementType search, ESqlStatementType[] src)
		{
			bool result = false;
			for (int i = 0; i < src.Length; i++)
			{
				if (src[i] == search)
				{
					result = true;
					break;
				}
			}
			return result;
		}

		// Token: 0x060000B9 RID: 185 RVA: 0x0000751C File Offset: 0x0000571C
		internal Encoding GetEncoding(string filename)
		{
			byte[] array = new byte[4];
			using (FileStream fileStream = new FileStream(filename, FileMode.Open, FileAccess.Read))
			{
				fileStream.Read(array, 0, 4);
			}
			if (array[0] == 43 && array[1] == 47 && array[2] == 118)
			{
				return Encoding.UTF7;
			}
			if (array[0] == 239 && array[1] == 187 && array[2] == 191)
			{
				return Encoding.UTF8;
			}
			if (array[0] == 255 && array[1] == 254)
			{
				return Encoding.Unicode;
			}
			if (array[0] == 254 && array[1] == 255)
			{
				return Encoding.BigEndianUnicode;
			}
			if (array[0] == 0 && array[1] == 0 && array[2] == 254 && array[3] == 255)
			{
				return Encoding.UTF32;
			}
			return Encoding.ASCII;
		}

		// Token: 0x060000BA RID: 186 RVA: 0x000075FC File Offset: 0x000057FC
		internal virtual int getfileEncodingType(string fn)
		{
			int result = 0;
			try
			{
				Stream stream = new FileStream(this._sqlfilename, FileMode.Open, FileAccess.Read);
				byte[] array = new byte[4];
				stream.Read(array, 0, array.Length);
				if ((array[0] == 255 && array[1] == 254) || (array[0] == 254 && array[1] == 255))
				{
					result = 1;
					if ((array[2] == 255 && array[3] == 254) || (array[2] == 254 && array[3] == 255))
					{
						result = 2;
					}
				}
				else if (array[0] == 239 && array[1] == 187 && array[2] == 191)
				{
					result = 3;
				}
			}
			catch (FileNotFoundException)
			{
			}
			catch (IOException)
			{
			}
			return result;
		}

		// Token: 0x060000BB RID: 187 RVA: 0x000076C8 File Offset: 0x000058C8
		internal virtual int readsql()
		{
			int num = 0;
			this.syntaxErrors.Clear();
			TGSharpSqlParser.licenseType = "dist";
			TGSharpSqlParser.userName = "dist";
			try
			{
				if (this.finputstream != null)
				{
					this.finputstream.Close();
				}
				if (this.flexer == null)
				{
					num = -1;
					this.errormessage = "requested database not supported:" + this.dbVendor.ToString();
					return num;
				}
				if (this.flexer.yyinput != null)
				{
					this.flexer.yyinput.Close();
				}
			}
			catch (IOException)
			{
				num = -1;
				this.errormessage = "requested database not supported";
			}
			if (this._sqltext.Length > 0)
			{
				this.finputstream = new StreamReader(new MemoryStream(Encoding.UTF8.GetBytes(this._sqltext)));
				//if (this._sqltext.Length > 10000)
				//{
				//	this.errormessage = TBaseType.trail_version_query_message;
				//	num = -1;
				//}
			}
			else
			{
				if (this._sqlfilename.Length > 0)
				{
					try
					{
						StreamReader streamReader = new StreamReader(new FileStream(this._sqlfilename, FileMode.Open, FileAccess.Read), this.GetEncoding(this._sqlfilename));
						this.finputstream = streamReader;
						if (!File.Exists(this._sqlfilename))
						{
							num = -1;
							this.errormessage = "not a valid sql file.";
						}
						//else if (new FileInfo(this._sqlfilename).Length > 10000L)
						//{
						//	this.errormessage = TBaseType.trail_version_file_message;
						//	num = -1;
						//}
						goto IL_1E1;
					}
					catch (FileNotFoundException ex)
					{
						num = -1;
						this.errormessage = ex.ToString();
						goto IL_1E1;
					}
					catch (IOException ex2)
					{
						Console.WriteLine(ex2.ToString());
						Console.Write(ex2.StackTrace);
						goto IL_1E1;
					}
				}
				if (this.sqlInputStream != null)
				{
					this.finputstream = new StreamReader(this.sqlInputStream);
					try
					{
						//if (this.sqlInputStream.Length > 10000L)
						//{
						//	this.errormessage = TBaseType.trail_version_query_message;
						//	num = -1;
						//}
					}
					catch (IOException ex3)
					{
						Console.WriteLine(ex3.ToString());
						Console.Write(ex3.StackTrace);
					}
				}
			}
			IL_1E1:
			if (this.finputstream == null)
			{
				num = -1;
			}
			if (num == 0)
			{
				this.flexer.yyinput = this.finputstream;
			}
			this.sourcetokenlist.clear();
			this.sourcetokenlist.curpos = -1;
			return num;
		}

		// Token: 0x060000BC RID: 188 RVA: 0x00007924 File Offset: 0x00005B24
		internal virtual TSourceToken getanewsourcetoken()
		{
			TSourceToken tsourceToken;
			TSourceToken tsourceToken2;
			for (;;)
			{
				tsourceToken = new TSourceToken("");
				if (this.flexer.yylexwrap(tsourceToken) == 0)
				{
					break;
				}
				tsourceToken.Dbvendor = this.dbVendor;
				tsourceToken.tokenstatus = ETokenStatus.tsoriginal;
				if (tsourceToken.tokentype == ETokenType.ttreturn)
				{
					tsourceToken.astext = this.towinlinebreak(tsourceToken.astext);
				}
				if (tsourceToken.tokentype == ETokenType.ttwhitespace && this.sourcetokenlist.curpos >= 0)
				{
					tsourceToken2 = this.sourcetokenlist.get(this.sourcetokenlist.curpos);
					if (tsourceToken2.tokentype == ETokenType.ttreturn)
					{
						tsourceToken2.astext += tsourceToken.astext;
						continue;
					}
				}
				if (tsourceToken.tokentype != ETokenType.ttreturn || this.sourcetokenlist.curpos < 0)
				{
					goto IL_FF;
				}
				tsourceToken2 = this.sourcetokenlist.get(this.sourcetokenlist.curpos);
				if (tsourceToken2.tokentype != ETokenType.ttreturn)
				{
					goto IL_F6;
				}
				tsourceToken2.astext += tsourceToken.astext;
			}
			tsourceToken = null;
			goto IL_FF;
			IL_F6:
			ETokenType tokentype = tsourceToken2.tokentype;
			IL_FF:
			if (tsourceToken != null)
			{
				tsourceToken.container = this.sourcetokenlist;
				this.sourcetokenlist.curpos = this.sourcetokenlist.curpos + 1;
				tsourceToken.posinlist = this.sourcetokenlist.curpos;
				if (this.tokenHandle != null)
				{
					this.tokenHandle.processToken(tsourceToken);
				}
			}
			return tsourceToken;
		}

		// Token: 0x060000BD RID: 189 RVA: 0x00007A7E File Offset: 0x00005C7E
		internal virtual string towinlinebreak(string s)
		{
			return s;
		}

		// Token: 0x060000BE RID: 190 RVA: 0x00007A84 File Offset: 0x00005C84
		internal virtual void checkconstarinttoken(TSourceToken lcprevtoken)
		{
			TSourceTokenList container = lcprevtoken.container;
			if (TBaseType.assigned(container))
			{
				TSourceToken tsourceToken = container.nextsolidtoken(lcprevtoken.posinlist, -2, false);
				if (TBaseType.assigned(tsourceToken) && tsourceToken.tokencode == TLexerMssql.getkeywordvalue("constraint"))
				{
					tsourceToken.tokencode = 298;
				}
			}
		}

		// Token: 0x060000BF RID: 191 RVA: 0x00007AD8 File Offset: 0x00005CD8
		internal virtual TSourceToken getprevtoken(TSourceToken ptoken)
		{
			TSourceTokenList container = ptoken.container;
			if (!TBaseType.assigned(container) || ptoken.posinlist <= 0 || container.size() <= ptoken.posinlist - 1)
			{
				return null;
			}
			if (container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttwhitespace && container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttreturn && container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttsimplecomment && container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttbracketedcomment)
			{
				return container.get(ptoken.posinlist - 1);
			}
			return container.nextsolidtoken(ptoken.posinlist - 1, -1, false);
		}

		// Token: 0x060000C0 RID: 192 RVA: 0x00007B8C File Offset: 0x00005D8C
		internal virtual void doinformixtexttotokenlist()
		{
			TSourceToken tsourceToken = null;
			int num = 0;
			TSourceToken tsourceToken2 = this.getanewsourcetoken();
			if (tsourceToken2 == null)
			{
				return;
			}
			int i = tsourceToken2.tokencode;
			bool flag = false;
			int num2 = 0;
			while (i > 0)
			{
				if (tsourceToken2.tokencode == 464)
				{
					flag = true;
					num2 = 0;
				}
				else if (tsourceToken2.tokentype == ETokenType.ttleftparenthesis)
				{
					if (num > 0 && TBaseType.assigned(tsourceToken))
					{
						if (tsourceToken.tokencode == 513)
						{
							tsourceToken.tokencode = 299;
						}
						else if (tsourceToken.tokencode == 516)
						{
							tsourceToken.tokencode = 297;
						}
						else if (tsourceToken.tokencode == 514)
						{
							tsourceToken.tokencode = 300;
						}
						else if (tsourceToken.tokencode == 338)
						{
							tsourceToken.tokencode = 295;
						}
						tsourceToken = null;
						num = 0;
					}
					if (flag)
					{
						num2++;
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttrightparenthesis)
				{
					if (flag)
					{
						if (num2 > 0)
						{
							num2--;
						}
						if (num2 == 0)
						{
							flag = false;
						}
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
				{
					if (flag)
					{
						tsourceToken2.tokentype = ETokenType.ttsemicolon2;
					}
					else
					{
						TSourceToken tsourceToken3 = tsourceToken2.searchToken(351, -1);
						if (tsourceToken3 != null)
						{
							tsourceToken2.tokencode = 531;
							tsourceToken2.tokentype = ETokenType.ttsemicolon3;
						}
						else
						{
							tsourceToken3 = tsourceToken2.searchToken(456, -1);
							if (tsourceToken3 == null)
							{
								tsourceToken3 = tsourceToken2.searchToken(462, -1);
							}
							if (tsourceToken3 != null && tsourceToken2.searchToken(351, -2) != null)
							{
								tsourceToken2.tokencode = 531;
								tsourceToken2.tokentype = ETokenType.ttsemicolon3;
							}
						}
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttperiod)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 463)
					{
						tsourceToken4.tokencode = 264;
						tsourceToken4.tokentype = ETokenType.ttidentifier;
					}
				}
				else if (tsourceToken2.tokencode == 308)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 473)
					{
						tsourceToken4.tokencode = 296;
					}
				}
				else if (tsourceToken2.tokencode == 512)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 481)
					{
						tsourceToken4.tokencode = 276;
					}
				}
				else if (tsourceToken2.tokencode == 463)
				{
					bool flag2 = true;
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.lineNo == tsourceToken2.lineNo)
					{
						flag2 = false;
					}
					if (flag2)
					{
						flag = false;
						num2 = 0;
						tsourceToken = tsourceToken2;
					}
					else
					{
						tsourceToken2.tokencode = 264;
						tsourceToken2.tokentype = ETokenType.ttidentifier;
					}
				}
				else if (tsourceToken2.tokencode == 513)
				{
					num = 2;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.tokencode == 516)
				{
					num = 2;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.tokencode == 514)
				{
					num = 1;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.issolidtoken() && num > 0 && !TBaseType.mysametext("clustered", tsourceToken2.astext) && !TBaseType.mysametext("nonclustered", tsourceToken2.astext))
				{
					num--;
				}
				this.sourcetokenlist.add(tsourceToken2);
				tsourceToken2 = this.getanewsourcetoken();
				if (tsourceToken2 != null)
				{
					i = tsourceToken2.tokencode;
				}
				else
				{
					i = 0;
				}
			}
		}

		// Token: 0x060000C1 RID: 193 RVA: 0x00007EE0 File Offset: 0x000060E0
		internal virtual void domssqlsqltexttotokenlist()
		{
			TSourceToken tsourceToken = null;
			int num = 0;
			TSourceToken tsourceToken2 = this.getanewsourcetoken();
			if (tsourceToken2 == null)
			{
				return;
			}
			int i = tsourceToken2.tokencode;
			bool flag = false;
			int num2 = 0;
			while (i > 0)
			{
				if (tsourceToken2.tokencode == 464)
				{
					flag = true;
					num2 = 0;
				}
				else if (tsourceToken2.tokentype == ETokenType.ttleftparenthesis)
				{
					if (num > 0 && TBaseType.assigned(tsourceToken))
					{
						if (tsourceToken.tokencode == 513)
						{
							tsourceToken.tokencode = 299;
							this.checkconstarinttoken(tsourceToken);
						}
						else if (tsourceToken.tokencode == 516)
						{
							tsourceToken.tokencode = 297;
							this.checkconstarinttoken(tsourceToken);
						}
						else if (tsourceToken.tokencode == 514)
						{
							tsourceToken.tokencode = 300;
							this.checkconstarinttoken(tsourceToken);
						}
						tsourceToken = null;
						num = 0;
					}
					if (flag)
					{
						num2++;
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttrightparenthesis)
				{
					if (flag)
					{
						if (num2 > 0)
						{
							num2--;
						}
						if (num2 == 0)
						{
							flag = false;
						}
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
				{
					if (flag)
					{
						tsourceToken2.tokentype = ETokenType.ttsemicolon2;
					}
					else
					{
						TSourceToken tsourceToken3 = tsourceToken2.searchToken(351, -1);
						if (tsourceToken3 != null)
						{
							tsourceToken2.tokencode = 531;
							tsourceToken2.tokentype = ETokenType.ttsemicolon3;
						}
						else
						{
							tsourceToken3 = tsourceToken2.searchToken(456, -1);
							if (tsourceToken3 == null)
							{
								tsourceToken3 = tsourceToken2.searchToken(462, -1);
							}
							if (tsourceToken3 != null && tsourceToken2.searchToken(351, -2) != null)
							{
								tsourceToken2.tokencode = 531;
								tsourceToken2.tokentype = ETokenType.ttsemicolon3;
							}
						}
					}
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (tsourceToken4 != null && tsourceToken4.tokentype == ETokenType.ttsemicolon)
					{
						tsourceToken2.tokencode = 259;
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttperiod)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 463)
					{
						tsourceToken4.tokencode = 264;
						tsourceToken4.tokentype = ETokenType.ttidentifier;
					}
				}
				else if (tsourceToken2.tokencode == 308)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 473)
					{
						tsourceToken4.tokencode = 296;
					}
				}
				else if (tsourceToken2.tokencode == 463)
				{
					bool flag2 = true;
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.lineNo == tsourceToken2.lineNo)
					{
						flag2 = false;
					}
					if (flag2)
					{
						flag = false;
						num2 = 0;
						tsourceToken = tsourceToken2;
					}
					else
					{
						tsourceToken2.tokencode = 264;
						tsourceToken2.tokentype = ETokenType.ttidentifier;
					}
				}
				else if (tsourceToken2.tokencode == 513)
				{
					num = 2;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.tokencode == 516)
				{
					num = 2;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.tokencode == 514)
				{
					num = 1;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.issolidtoken() && num > 0 && !TBaseType.mysametext("clustered", tsourceToken2.astext) && !TBaseType.mysametext("nonclustered", tsourceToken2.astext))
				{
					num--;
				}
				this.sourcetokenlist.add(tsourceToken2);
				tsourceToken2 = this.getanewsourcetoken();
				if (tsourceToken2 != null)
				{
					i = tsourceToken2.tokencode;
				}
				else
				{
					i = 0;
				}
			}
		}

		// Token: 0x060000C2 RID: 194 RVA: 0x0000820C File Offset: 0x0000640C
		internal virtual void dosybasesqltexttotokenlist()
		{
			TSourceToken tsourceToken = null;
			int num = 0;
			TSourceToken tsourceToken2 = this.getanewsourcetoken();
			if (tsourceToken2 == null)
			{
				return;
			}
			int i = tsourceToken2.tokencode;
			bool flag = false;
			int num2 = 0;
			while (i > 0)
			{
				if (tsourceToken2.tokencode == 464)
				{
					flag = true;
					num2 = 0;
				}
				else if (tsourceToken2.tokentype == ETokenType.ttleftparenthesis)
				{
					if (num > 0 && TBaseType.assigned(tsourceToken))
					{
						if (tsourceToken.tokencode == 513)
						{
							tsourceToken.tokencode = 299;
							this.checkconstarinttoken(tsourceToken);
						}
						else if (tsourceToken.tokencode == 516)
						{
							tsourceToken.tokencode = 297;
							this.checkconstarinttoken(tsourceToken);
						}
						else if (tsourceToken.tokencode == 514)
						{
							tsourceToken.tokencode = 300;
							this.checkconstarinttoken(tsourceToken);
						}
						tsourceToken = null;
						num = 0;
					}
					if (flag)
					{
						num2++;
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttrightparenthesis)
				{
					if (flag)
					{
						if (num2 > 0)
						{
							num2--;
						}
						if (num2 == 0)
						{
							flag = false;
						}
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
				{
					if (flag)
					{
						tsourceToken2.tokentype = ETokenType.ttsemicolon2;
					}
					else
					{
						TSourceToken tsourceToken3 = tsourceToken2.searchToken(351, -1);
						if (tsourceToken3 != null)
						{
							tsourceToken2.tokencode = 531;
							tsourceToken2.tokentype = ETokenType.ttsemicolon3;
						}
						else
						{
							tsourceToken3 = tsourceToken2.searchToken(456, -1);
							if (tsourceToken3 == null)
							{
								tsourceToken3 = tsourceToken2.searchToken(462, -1);
							}
							if (tsourceToken3 != null && tsourceToken2.searchToken(351, -2) != null)
							{
								tsourceToken2.tokencode = 531;
								tsourceToken2.tokentype = ETokenType.ttsemicolon3;
							}
						}
					}
				}
				else if (tsourceToken2.tokentype == ETokenType.ttperiod)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 463)
					{
						tsourceToken4.tokencode = 264;
						tsourceToken4.tokentype = ETokenType.ttidentifier;
					}
				}
				else if (tsourceToken2.tokencode == 308)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 473)
					{
						tsourceToken4.tokencode = 296;
					}
				}
				else if (tsourceToken2.tokencode == 560)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 559)
					{
						tsourceToken4.tokencode = 287;
					}
				}
				else if (tsourceToken2.tokencode == 304)
				{
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && (tsourceToken4.tokencode == 321 || tsourceToken4.tokencode == 319 || tsourceToken4.tokencode == 320 || tsourceToken4.tokencode == 305))
					{
						tsourceToken2.tokencode = 288;
					}
				}
				else if (tsourceToken2.tokencode == 463)
				{
					bool flag2 = true;
					TSourceToken tsourceToken4 = this.getprevtoken(tsourceToken2);
					if (TBaseType.assigned(tsourceToken4) && tsourceToken4.lineNo == tsourceToken2.lineNo)
					{
						flag2 = false;
					}
					if (flag2)
					{
						flag = false;
						num2 = 0;
						tsourceToken = tsourceToken2;
					}
					else
					{
						tsourceToken2.tokencode = 264;
						tsourceToken2.tokentype = ETokenType.ttidentifier;
					}
				}
				else if (tsourceToken2.tokencode == 513)
				{
					num = 2;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.tokencode == 516)
				{
					num = 2;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.tokencode == 514)
				{
					num = 1;
					tsourceToken = tsourceToken2;
				}
				else if (tsourceToken2.issolidtoken() && num > 0 && !TBaseType.mysametext("clustered", tsourceToken2.astext) && !TBaseType.mysametext("nonclustered", tsourceToken2.astext))
				{
					num--;
				}
				this.sourcetokenlist.add(tsourceToken2);
				tsourceToken2 = this.getanewsourcetoken();
				if (tsourceToken2 != null)
				{
					i = tsourceToken2.tokencode;
				}
				else
				{
					i = 0;
				}
			}
		}

		// Token: 0x060000C3 RID: 195 RVA: 0x000085C4 File Offset: 0x000067C4
		internal virtual bool IsValidPlaceForDivToSqlplusCmd(TSourceTokenList pstlist, int pPos)
		{
			bool result = false;
			if (pPos <= 0 || pPos > pstlist.size() - 1)
			{
				return result;
			}
			TSourceToken tsourceToken = pstlist.get(pPos - 1);
			if (tsourceToken.tokentype != ETokenType.ttreturn)
			{
				return result;
			}
			if (tsourceToken.astext[tsourceToken.astext.Length - 1] != ' ')
			{
				result = true;
			}
			return result;
		}

		// Token: 0x060000C4 RID: 196 RVA: 0x00008618 File Offset: 0x00006818
		internal virtual bool isvalidsqlpluscmdInPostgresql(string astr)
		{
			return false;
		}

		// Token: 0x060000C5 RID: 197 RVA: 0x0000861C File Offset: 0x0000681C
		internal virtual bool isvalidsqlpluscmd(string astr)
		{
			if (astr == null)
			{
				return false;
			}
			bool result = false;
			if (TGSharpSqlParser.sqlpluskeywordList.Count == 0)
			{
				TGSharpSqlParser.sqlpluskeywordList["ACC"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["ACCEPT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["A"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["APPEND"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["ATTRIBUTE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["BRE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["BREAK"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["BTI"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["BTITLE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["C"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["CHANGE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["CL"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["CLEAR"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["COL"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["COLUMN"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["COMP"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["COMPUTE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["CONN"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["CONNECT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["COPY"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DEF"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DEFINE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DEL"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DESC"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DESCRIBE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DISC"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["DISCONNECT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["ED"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["EDIT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["EXEC"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["EXIT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["QUIT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["GET"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["HELP"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["HO"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["HOST"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["I"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["INPUT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["L"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["LIST"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PASSW"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PASSWORD"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PAU"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PAUSE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PRI"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PRINT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["PROMPT"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["REM"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["REMARK"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["REPF"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["REPFOOTER"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["REPH"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["REPHEADER"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["R"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["RUN"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SAV"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SAVE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SET"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SHO"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SHOW"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SPO"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["SPOOL"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["STA"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["START"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["STORE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["TIMI"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["TIMING"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["TTI"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["TTITLE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["UNDEF"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["UNDEFINE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["VAR"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["VARIABLE"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["WHENEVER"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["@"] = 1;
				TGSharpSqlParser.sqlpluskeywordList["@@"] = 1;
			}
			int num = 0;
			if (TGSharpSqlParser.sqlpluskeywordList.TryGetValue(astr.ToUpper(), out num))
			{
				result = true;
			}
			return result;
		}

		// Token: 0x060000C6 RID: 198 RVA: 0x00008B18 File Offset: 0x00006D18
		internal virtual TSourceToken getprevsolidtoken(TSourceToken ptoken)
		{
			TSourceToken result = null;
			TSourceTokenList container = ptoken.container;
			if (container != null && ptoken.posinlist > 0 && container.size() > ptoken.posinlist - 1)
			{
				if (container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttwhitespace && container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttreturn && container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttsimplecomment && container.get(ptoken.posinlist - 1).tokentype != ETokenType.ttbracketedcomment)
				{
					result = container.get(ptoken.posinlist - 1);
				}
				else
				{
					result = container.nextsolidtoken(ptoken.posinlist - 1, -1, false);
				}
			}
			return result;
		}

		// Token: 0x060000C7 RID: 199 RVA: 0x00008BCC File Offset: 0x00006DCC
		internal virtual void doredshifttexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = this.getanewsourcetoken();
			if (tsourceToken2 == null)
			{
				return;
			}
			int i = tsourceToken2.tokencode;
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken2);
				if (i - 257 > 2)
				{
					if (i != 260)
					{
						flag5 = false;
						flag4 = false;
						flag3 = false;
						if (flag)
						{
							tsourceToken2.insqlpluscmd = true;
							if (tsourceToken2.astext.Equals("-", StringComparison.CurrentCultureIgnoreCase))
							{
								flag5 = true;
							}
						}
						else
						{
							if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
							{
								flag4 = true;
							}
							if (tsourceToken2.tokentype == ETokenType.ttslash && (flag2 || this.IsValidPlaceForDivToSqlplusCmd(this.sourcetokenlist, tsourceToken2.posinlist)))
							{
								tsourceToken = tsourceToken2;
								flag3 = true;
							}
							if (flag2 && this.isvalidsqlpluscmdInPostgresql(tsourceToken2.astext))
							{
								tsourceToken2.tokencode = 273;
								if (tsourceToken2.tokentype != ETokenType.ttslash)
								{
									tsourceToken2.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
						}
						flag2 = false;
					}
					else
					{
						if (flag)
						{
							flag = false;
							flag2 = true;
							if (flag5)
							{
								flag = true;
								flag2 = false;
								tsourceToken2.insqlpluscmd = true;
							}
						}
						if (flag4)
						{
							flag2 = true;
						}
						if (flag3)
						{
							flag2 = true;
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
						}
						this.flexer.insqlpluscmd = flag;
					}
				}
				else if (flag)
				{
					tsourceToken2.insqlpluscmd = true;
				}
				tsourceToken2 = this.getanewsourcetoken();
				if (tsourceToken2 != null)
				{
					i = tsourceToken2.tokencode;
				}
				else
				{
					i = 0;
					if (flag3)
					{
						tsourceToken.tokencode = 273;
						if (tsourceToken.tokentype != ETokenType.ttslash)
						{
							tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
						}
					}
				}
				if (i == 0)
				{
				}
			}
		}

		// Token: 0x060000C8 RID: 200 RVA: 0x00008D7C File Offset: 0x00006F7C
		internal virtual void dopostgresqltexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			TSourceToken tsourceToken3 = this.getanewsourcetoken();
			if (tsourceToken3 == null)
			{
				return;
			}
			int i = tsourceToken3.tokencode;
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken3);
				if (i - 257 > 2)
				{
					if (i != 260)
					{
						flag5 = false;
						flag4 = false;
						flag3 = false;
						if (flag)
						{
							tsourceToken3.insqlpluscmd = true;
							if (tsourceToken3.astext.Equals("-", StringComparison.CurrentCultureIgnoreCase))
							{
								flag5 = true;
							}
						}
						else
						{
							if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
							{
								flag4 = true;
							}
							if (tsourceToken3.tokentype == ETokenType.ttslash && (flag2 || this.IsValidPlaceForDivToSqlplusCmd(this.sourcetokenlist, tsourceToken3.posinlist)))
							{
								tsourceToken = tsourceToken3;
								flag3 = true;
							}
							if (flag2 && this.isvalidsqlpluscmdInPostgresql(tsourceToken3.astext))
							{
								tsourceToken3.tokencode = 273;
								if (tsourceToken3.tokentype != ETokenType.ttslash)
								{
									tsourceToken3.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
						}
						flag2 = false;
						if (tsourceToken2 != null)
						{
							if (tsourceToken2.tokencode == 345 && tsourceToken3.tokencode != TLexerPostgresql.getkeywordvalue("JOIN"))
							{
								tsourceToken2.tokencode = 264;
							}
							if (tsourceToken2.tokencode == 321 && tsourceToken3.tokencode == TLexerPostgresql.getkeywordvalue("DEFERRABLE"))
							{
								tsourceToken2.tokencode = TLexerPostgresql.getkeywordvalue("NOT_DEFERRABLE");
							}
						}
						if (tsourceToken3.tokencode == 345)
						{
							tsourceToken2 = tsourceToken3;
						}
						else if (tsourceToken3.tokencode == 321)
						{
							tsourceToken2 = tsourceToken3;
						}
						else
						{
							tsourceToken2 = null;
						}
						if (tsourceToken3.tokencode == TLexerPostgresql.getkeywordvalue("DIRECT_LOAD") || tsourceToken3.tokencode == TLexerPostgresql.getkeywordvalue("ALL"))
						{
							TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken3);
							if (tsourceToken4 != null && tsourceToken4.tokencode == 306)
							{
								tsourceToken4.tokencode = 285;
							}
						}
						if (tsourceToken3.tokencode == 534)
						{
							TSourceToken tsourceToken5 = tsourceToken3.searchToken(532, -2);
							if (tsourceToken5 != null)
							{
								tsourceToken5.tokencode = 533;
							}
						}
					}
					else
					{
						if (flag)
						{
							flag = false;
							flag2 = true;
							if (flag5)
							{
								flag = true;
								flag2 = false;
								tsourceToken3.insqlpluscmd = true;
							}
						}
						if (flag4)
						{
							flag2 = true;
						}
						if (flag3)
						{
							flag2 = true;
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
						}
						this.flexer.insqlpluscmd = flag;
					}
				}
				else if (flag)
				{
					tsourceToken3.insqlpluscmd = true;
				}
				tsourceToken3 = this.getanewsourcetoken();
				if (tsourceToken3 != null)
				{
					i = tsourceToken3.tokencode;
				}
				else
				{
					i = 0;
					if (flag3)
					{
						tsourceToken.tokencode = 273;
						if (tsourceToken.tokentype != ETokenType.ttslash)
						{
							tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
						}
					}
				}
				if (i == 0 && tsourceToken2 != null && tsourceToken2.tokencode == 345)
				{
					tsourceToken2.tokencode = 264;
				}
			}
		}

		// Token: 0x060000C9 RID: 201 RVA: 0x00009054 File Offset: 0x00007254
		internal virtual void dogreenplumtexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			TSourceToken tsourceToken3 = this.getanewsourcetoken();
			if (tsourceToken3 == null)
			{
				return;
			}
			int i = tsourceToken3.tokencode;
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken3);
				if (i - 257 > 2)
				{
					if (i != 260)
					{
						flag5 = false;
						flag4 = false;
						flag3 = false;
						if (flag)
						{
							tsourceToken3.insqlpluscmd = true;
							if (tsourceToken3.astext.Equals("-", StringComparison.CurrentCultureIgnoreCase))
							{
								flag5 = true;
							}
						}
						else
						{
							if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
							{
								flag4 = true;
							}
							if (tsourceToken3.tokentype == ETokenType.ttslash && (flag2 || this.IsValidPlaceForDivToSqlplusCmd(this.sourcetokenlist, tsourceToken3.posinlist)))
							{
								tsourceToken = tsourceToken3;
								flag3 = true;
							}
							if (flag2 && this.isvalidsqlpluscmdInPostgresql(tsourceToken3.astext))
							{
								tsourceToken3.tokencode = 273;
								if (tsourceToken3.tokentype != ETokenType.ttslash)
								{
									tsourceToken3.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
						}
						flag2 = false;
						if (tsourceToken2 != null)
						{
							if (tsourceToken2.tokencode == 345 && tsourceToken3.tokencode != TLexerGreenplum.getkeywordvalue("JOIN"))
							{
								tsourceToken2.tokencode = 264;
							}
							if (tsourceToken2.tokencode == 321 && tsourceToken3.tokencode == TLexerGreenplum.getkeywordvalue("DEFERRABLE"))
							{
								tsourceToken2.tokencode = TLexerGreenplum.getkeywordvalue("NOT_DEFERRABLE");
							}
						}
						if (tsourceToken3.tokencode == 345)
						{
							tsourceToken2 = tsourceToken3;
						}
						else if (tsourceToken3.tokencode == 321)
						{
							tsourceToken2 = tsourceToken3;
						}
						else
						{
							tsourceToken2 = null;
						}
						if (tsourceToken3.tokencode == TLexerGreenplum.getkeywordvalue("DIRECT_LOAD") || tsourceToken3.tokencode == TLexerGreenplum.getkeywordvalue("ALL"))
						{
							TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken3);
							if (tsourceToken4 != null && tsourceToken4.tokencode == 306)
							{
								tsourceToken4.tokencode = 285;
							}
						}
						if (tsourceToken3.tokencode == 534)
						{
							TSourceToken tsourceToken5 = tsourceToken3.searchToken(532, -2);
							if (tsourceToken5 != null)
							{
								tsourceToken5.tokencode = 533;
							}
						}
					}
					else
					{
						if (flag)
						{
							flag = false;
							flag2 = true;
							if (flag5)
							{
								flag = true;
								flag2 = false;
								tsourceToken3.insqlpluscmd = true;
							}
						}
						if (flag4)
						{
							flag2 = true;
						}
						if (flag3)
						{
							flag2 = true;
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
						}
						this.flexer.insqlpluscmd = flag;
					}
				}
				else if (flag)
				{
					tsourceToken3.insqlpluscmd = true;
				}
				tsourceToken3 = this.getanewsourcetoken();
				if (tsourceToken3 != null)
				{
					i = tsourceToken3.tokencode;
				}
				else
				{
					i = 0;
					if (flag3)
					{
						tsourceToken.tokencode = 273;
						if (tsourceToken.tokentype != ETokenType.ttslash)
						{
							tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
						}
					}
				}
				if (i == 0 && tsourceToken2 != null && tsourceToken2.tokencode == 345)
				{
					tsourceToken2.tokencode = 264;
				}
			}
		}

		// Token: 0x060000CA RID: 202 RVA: 0x0000932C File Offset: 0x0000752C
		internal virtual void donetezzatexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			TSourceToken tsourceToken3 = this.getanewsourcetoken();
			if (tsourceToken3 == null)
			{
				return;
			}
			int i = tsourceToken3.tokencode;
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken3);
				if (i - 257 > 2)
				{
					if (i != 260)
					{
						flag5 = false;
						flag4 = false;
						flag3 = false;
						if (flag)
						{
							tsourceToken3.insqlpluscmd = true;
							if (tsourceToken3.astext.Equals("-", StringComparison.CurrentCultureIgnoreCase))
							{
								flag5 = true;
							}
						}
						else
						{
							if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
							{
								flag4 = true;
							}
							if (tsourceToken3.tokentype == ETokenType.ttslash && (flag2 || this.IsValidPlaceForDivToSqlplusCmd(this.sourcetokenlist, tsourceToken3.posinlist)))
							{
								tsourceToken = tsourceToken3;
								flag3 = true;
							}
							if (flag2 && this.isvalidsqlpluscmdInPostgresql(tsourceToken3.astext))
							{
								tsourceToken3.tokencode = 273;
								if (tsourceToken3.tokentype != ETokenType.ttslash)
								{
									tsourceToken3.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
						}
						flag2 = false;
						if (tsourceToken2 != null)
						{
							if (tsourceToken2.tokencode == 345 && tsourceToken3.tokencode != TLexerNetezza.getkeywordvalue("JOIN"))
							{
								tsourceToken2.tokencode = 264;
							}
							if (tsourceToken2.tokencode == 321 && tsourceToken3.tokencode == TLexerNetezza.getkeywordvalue("DEFERRABLE"))
							{
								tsourceToken2.tokencode = TLexerNetezza.getkeywordvalue("NOT_DEFERRABLE");
							}
						}
						if (tsourceToken3.tokencode == 345)
						{
							tsourceToken2 = tsourceToken3;
						}
						else if (tsourceToken3.tokencode == 321)
						{
							tsourceToken2 = tsourceToken3;
						}
						else
						{
							tsourceToken2 = null;
						}
						if (tsourceToken3.tokencode == TLexerNetezza.getkeywordvalue("DIRECT_LOAD") || tsourceToken3.tokencode == TLexerNetezza.getkeywordvalue("ALL"))
						{
							TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken3);
							if (tsourceToken4 != null && tsourceToken4.tokencode == 306)
							{
								tsourceToken4.tokencode = 285;
							}
						}
						if (tsourceToken3.tokencode == 534)
						{
							TSourceToken tsourceToken5 = tsourceToken3.searchToken(532, -2);
							if (tsourceToken5 != null)
							{
								tsourceToken5.tokencode = 533;
							}
						}
					}
					else
					{
						if (flag)
						{
							flag = false;
							flag2 = true;
							if (flag5)
							{
								flag = true;
								flag2 = false;
								tsourceToken3.insqlpluscmd = true;
							}
						}
						if (flag4)
						{
							flag2 = true;
						}
						if (flag3)
						{
							flag2 = true;
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
						}
						this.flexer.insqlpluscmd = flag;
					}
				}
				else if (flag)
				{
					tsourceToken3.insqlpluscmd = true;
				}
				tsourceToken3 = this.getanewsourcetoken();
				if (tsourceToken3 != null)
				{
					i = tsourceToken3.tokencode;
				}
				else
				{
					i = 0;
					if (flag3)
					{
						tsourceToken.tokencode = 273;
						if (tsourceToken.tokentype != ETokenType.ttslash)
						{
							tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
						}
					}
				}
				if (i == 0 && tsourceToken2 != null && tsourceToken2.tokencode == 345)
				{
					tsourceToken2.tokencode = 264;
				}
			}
		}

		// Token: 0x060000CB RID: 203 RVA: 0x00009604 File Offset: 0x00007804
		internal virtual void dooraclesqltexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			TSourceToken tsourceToken3 = this.getanewsourcetoken();
			if (tsourceToken3 == null)
			{
				return;
			}
			int i = tsourceToken3.tokencode;
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken3);
				if (i - 257 > 2)
				{
					if (i != 260)
					{
						flag5 = false;
						flag4 = false;
						flag3 = false;
						if (flag)
						{
							tsourceToken3.insqlpluscmd = true;
							if (tsourceToken3.astext.Equals("-", StringComparison.CurrentCultureIgnoreCase))
							{
								flag5 = true;
							}
						}
						else
						{
							if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
							{
								flag4 = true;
							}
							if (tsourceToken3.tokentype == ETokenType.ttslash && (flag2 || this.IsValidPlaceForDivToSqlplusCmd(this.sourcetokenlist, tsourceToken3.posinlist)))
							{
								tsourceToken = tsourceToken3;
								flag3 = true;
							}
							if (flag2 && this.isvalidsqlpluscmd(tsourceToken3.astext))
							{
								tsourceToken3.tokencode = 273;
								if (tsourceToken3.tokentype != ETokenType.ttslash)
								{
									tsourceToken3.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
							else if (tsourceToken3.tokencode == 481 && this.sourcetokenlist.returnbeforecurtoken(true))
							{
								tsourceToken3.tokencode = 273;
								if (tsourceToken3.tokentype != ETokenType.ttslash)
								{
									tsourceToken3.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
						}
						flag2 = false;
						if (tsourceToken2 != null)
						{
							if (tsourceToken2.tokencode == 345)
							{
								if (tsourceToken3.tokencode != TLexerOracle.getkeywordvalue("JOIN"))
								{
									tsourceToken2.tokencode = 264;
								}
							}
							else if (tsourceToken2.tokencode == 321 && tsourceToken3.tokencode == TLexerOracle.getkeywordvalue("DEFERRABLE"))
							{
								tsourceToken2.tokencode = TLexerOracle.getkeywordvalue("NOT_DEFERRABLE");
							}
						}
						if (tsourceToken3.tokencode == 345)
						{
							tsourceToken2 = tsourceToken3;
						}
						else if (tsourceToken3.tokencode == 321)
						{
							tsourceToken2 = tsourceToken3;
						}
						else
						{
							tsourceToken2 = null;
						}
						if (tsourceToken3.tokencode == TLexerOracle.getkeywordvalue("DIRECT_LOAD") || tsourceToken3.tokencode == TLexerOracle.getkeywordvalue("ALL"))
						{
							TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken3);
							if (tsourceToken4 != null && tsourceToken4.tokencode == 306)
							{
								tsourceToken4.tokencode = 285;
							}
						}
						else if (tsourceToken3.tokencode == 534)
						{
							TSourceToken tsourceToken5 = tsourceToken3.searchToken(532, -2);
							if (tsourceToken5 != null)
							{
								tsourceToken5.tokencode = 533;
							}
						}
						else if (tsourceToken3.tokencode == 346)
						{
							if (tsourceToken3.searchToken(538, -1) != null)
							{
								tsourceToken3.tokencode = 279;
							}
						}
						else if (tsourceToken3.tokencode == 324)
						{
							TSourceToken tsourceToken6 = tsourceToken3.searchToken(346, -1);
							if (tsourceToken6 != null)
							{
								tsourceToken6.tokencode = 279;
							}
							else
							{
								TSourceToken tsourceToken7 = tsourceToken3.searchToken(539, -4);
								if (tsourceToken7 != null)
								{
									tsourceToken7.tokencode = 276;
								}
							}
						}
						else if (tsourceToken3.tokencode == 347)
						{
							TSourceToken tsourceToken8 = tsourceToken3.searchToken(346, -1);
							if (tsourceToken8 != null)
							{
								tsourceToken8.tokencode = 279;
							}
						}
						else if (tsourceToken3.tokencode == 525)
						{
							TSourceToken tsourceToken9 = tsourceToken3.searchToken(541, -2);
							if (tsourceToken9 != null)
							{
								tsourceToken9.tokencode = 540;
							}
						}
						else if (tsourceToken3.tokencode == 341)
						{
							TSourceToken tsourceToken10 = tsourceToken3.searchToken(541, -2);
							if (tsourceToken10 != null)
							{
								tsourceToken10.tokencode = 540;
							}
						}
						else if (tsourceToken3.tokencode == 543)
						{
							TSourceToken tsourceToken11 = tsourceToken3.searchToken(541, -2);
							if (tsourceToken11 != null)
							{
								tsourceToken11.tokencode = 540;
							}
						}
						else if (tsourceToken3.tokencode == 541)
						{
							if (tsourceToken3.searchToken(314, -1) != null)
							{
								tsourceToken3.tokencode = 540;
							}
							if (tsourceToken3.tokencode == 541 && tsourceToken3.searchToken(542, -1) != null)
							{
								tsourceToken3.tokencode = 540;
							}
							if (tsourceToken3.tokencode == 541 && tsourceToken3.searchToken(542, -1) != null)
							{
								tsourceToken3.tokencode = 540;
							}
							if (tsourceToken3.tokencode == 541 && tsourceToken3.searchToken(307, -1) != null)
							{
								tsourceToken3.tokencode = 540;
							}
							if (tsourceToken3.tokencode == 541 && tsourceToken3.searchToken(505, -1) != null)
							{
								tsourceToken3.tokencode = 540;
							}
							if (tsourceToken3.tokencode == 541 && tsourceToken3.searchToken(37, -1) != null)
							{
								tsourceToken3.tokencode = 540;
							}
						}
						else if (tsourceToken3.tokencode == 340 || tsourceToken3.tokencode == 512)
						{
							TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken3);
							if (tsourceToken4 != null && tsourceToken4.tokencode == 273 && tsourceToken4.ToString().Equals("connect", StringComparison.CurrentCultureIgnoreCase))
							{
								tsourceToken4.tokencode = 481;
								tsourceToken4.tokentype = ETokenType.ttkeyword;
								this.flexer.insqlpluscmd = false;
								flag5 = false;
								flag4 = false;
								flag3 = false;
								flag2 = false;
								flag = false;
							}
						}
						else if (tsourceToken3.tokencode == 325)
						{
							TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken3);
							if (tsourceToken4 != null && tsourceToken4.astext.ToString().Equals("a", StringComparison.CurrentCultureIgnoreCase))
							{
								TSourceToken tsourceToken12 = this.getprevsolidtoken(tsourceToken4);
								if (tsourceToken12 != null && (tsourceToken12.tokencode == 321 || tsourceToken12.tokencode == 525))
								{
									tsourceToken4.tokencode = 561;
									tsourceToken3.tokencode = 562;
								}
							}
						}
					}
					else
					{
						if (flag)
						{
							flag = false;
							flag2 = true;
							if (flag5)
							{
								flag = true;
								flag2 = false;
								tsourceToken3.insqlpluscmd = true;
							}
						}
						if (flag4)
						{
							flag2 = true;
						}
						if (flag3)
						{
							flag2 = true;
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
						}
						this.flexer.insqlpluscmd = flag;
					}
				}
				else if (flag)
				{
					tsourceToken3.insqlpluscmd = true;
				}
				tsourceToken3 = this.getanewsourcetoken();
				if (tsourceToken3 != null)
				{
					i = tsourceToken3.tokencode;
				}
				else
				{
					i = 0;
					if (flag3)
					{
						tsourceToken.tokencode = 273;
						if (tsourceToken.tokentype != ETokenType.ttslash)
						{
							tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
						}
					}
				}
				if (i == 0 && tsourceToken2 != null && tsourceToken2.tokencode == 345)
				{
					tsourceToken2.tokencode = 264;
				}
			}
		}

		// Token: 0x060000CC RID: 204 RVA: 0x00009CA0 File Offset: 0x00007EA0
		internal virtual void dodb2sqltexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			TSourceToken tsourceToken = this.getanewsourcetoken();
			if (tsourceToken == null)
			{
				return;
			}
			for (int i = tsourceToken.tokencode; i > 0; i = tsourceToken.tokencode)
			{
				if (i != 258)
				{
					if (i == 260)
					{
						flag = false;
						flag2 = true;
					}
					else
					{
						if (tsourceToken.tokencode == 530 || tsourceToken.tokencode == 531 || tsourceToken.tokencode == 532 || tsourceToken.tokencode == 533)
						{
							TSourceToken tsourceToken2 = this.getprevsolidtoken(tsourceToken);
							if (tsourceToken2 != null && tsourceToken2.tokencode == 311)
							{
								tsourceToken2.tokencode = 534;
							}
						}
						if (flag)
						{
							tsourceToken.insqlpluscmd = true;
						}
						else if (flag2 && TBaseType.mycomparetext(tsourceToken.astext.ToLower(), "echo") == 0)
						{
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
							tsourceToken.insqlpluscmd = true;
							flag = true;
						}
						flag2 = false;
					}
				}
				else
				{
					if (tsourceToken.astext.ToLower().IndexOf("scriptoptions", StringComparison.Ordinal) >= 0)
					{
						tsourceToken.tokencode = 281;
						tsourceToken.tokentype = ETokenType.ttidentifier;
					}
					if (flag)
					{
						tsourceToken.insqlpluscmd = true;
					}
				}
				this.sourcetokenlist.add(tsourceToken);
				tsourceToken = this.getanewsourcetoken();
				if (tsourceToken == null)
				{
					break;
				}
			}
		}

		// Token: 0x060000CD RID: 205 RVA: 0x00009DF0 File Offset: 0x00007FF0
		internal virtual void doTeradatatexttotokenlist()
		{
			TSourceToken tsourceToken = this.getanewsourcetoken();
			if (tsourceToken == null)
			{
				return;
			}
			for (int i = tsourceToken.tokencode; i > 0; i = tsourceToken.tokencode)
			{
				this.sourcetokenlist.add(tsourceToken);
				tsourceToken = this.getanewsourcetoken();
				if (tsourceToken == null)
				{
					break;
				}
				if (tsourceToken.tokencode == 552 || tsourceToken.tokencode == 553)
				{
					TSourceToken tsourceToken2 = this.getprevsolidtoken(tsourceToken);
					if (tsourceToken2 != null && tsourceToken2.tokencode == 321)
					{
						tsourceToken2.tokencode = 285;
					}
				}
			}
		}

		// Token: 0x060000CE RID: 206 RVA: 0x00009E70 File Offset: 0x00008070
		internal virtual void docommonsqltexttotokenlist()
		{
			TSourceToken tsourceToken = this.getanewsourcetoken();
			if (tsourceToken == null)
			{
				return;
			}
			for (int i = tsourceToken.tokencode; i > 0; i = tsourceToken.tokencode)
			{
				this.sourcetokenlist.add(tsourceToken);
				tsourceToken = this.getanewsourcetoken();
				if (tsourceToken == null)
				{
					break;
				}
			}
		}

		// Token: 0x060000CF RID: 207 RVA: 0x00009EB4 File Offset: 0x000080B4
		internal virtual void dohivetexttotokenlist()
		{
			TSourceToken tsourceToken = this.getanewsourcetoken();
			if (tsourceToken == null)
			{
				return;
			}
			for (int i = tsourceToken.tokencode; i > 0; i = tsourceToken.tokencode)
			{
				this.sourcetokenlist.add(tsourceToken);
				tsourceToken = this.getanewsourcetoken();
				if (tsourceToken == null)
				{
					break;
				}
				if (tsourceToken.tokencode == 534 && tsourceToken.searchToken(41, -1) != null)
				{
					tsourceToken.tokencode = 264;
				}
			}
		}

		// Token: 0x060000D0 RID: 208 RVA: 0x00009F1C File Offset: 0x0000811C
		internal virtual void dosnowflaketexttotokenlist()
		{
			bool flag = false;
			bool flag2 = true;
			bool flag3 = false;
			bool flag4 = false;
			bool flag5 = false;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			TSourceToken tsourceToken3 = this.getanewsourcetoken();
			if (tsourceToken3 == null)
			{
				return;
			}
			int i = tsourceToken3.tokencode;
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken3);
				if (i - 257 > 2)
				{
					if (i != 260)
					{
						flag5 = false;
						flag4 = false;
						flag3 = false;
						if (flag)
						{
							tsourceToken3.insqlpluscmd = true;
							if (tsourceToken3.astext.Equals("-", StringComparison.CurrentCultureIgnoreCase))
							{
								flag5 = true;
							}
						}
						else
						{
							if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
							{
								flag4 = true;
							}
							if (tsourceToken3.tokentype == ETokenType.ttslash && (flag2 || this.IsValidPlaceForDivToSqlplusCmd(this.sourcetokenlist, tsourceToken3.posinlist)))
							{
								tsourceToken = tsourceToken3;
								flag3 = true;
							}
							if (flag2 && this.isvalidsqlpluscmdInPostgresql(tsourceToken3.astext))
							{
								tsourceToken3.tokencode = 273;
								if (tsourceToken3.tokentype != ETokenType.ttslash)
								{
									tsourceToken3.tokentype = ETokenType.ttsqlpluscmd;
								}
								flag = true;
								this.flexer.insqlpluscmd = flag;
							}
						}
						flag2 = false;
						if (tsourceToken2 != null)
						{
							if (tsourceToken2.tokencode == 345 && tsourceToken3.tokencode != TLexerSnowflake.getkeywordvalue("JOIN"))
							{
								tsourceToken2.tokencode = 264;
							}
							if (tsourceToken2.tokencode == 321 && tsourceToken3.tokencode == TLexerSnowflake.getkeywordvalue("DEFERRABLE"))
							{
								tsourceToken2.tokencode = TLexerSnowflake.getkeywordvalue("NOT_DEFERRABLE");
							}
						}
						if (tsourceToken3.tokencode == 345)
						{
							tsourceToken2 = tsourceToken3;
						}
						else if (tsourceToken3.tokencode == 321)
						{
							tsourceToken2 = tsourceToken3;
						}
						else
						{
							tsourceToken2 = null;
						}
					}
					else
					{
						if (flag)
						{
							flag = false;
							flag2 = true;
							if (flag5)
							{
								flag = true;
								flag2 = false;
								tsourceToken3.insqlpluscmd = true;
							}
						}
						if (flag4)
						{
							flag2 = true;
						}
						if (flag3)
						{
							flag2 = true;
							tsourceToken.tokencode = 273;
							if (tsourceToken.tokentype != ETokenType.ttslash)
							{
								tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
							}
						}
						this.flexer.insqlpluscmd = flag;
					}
				}
				else if (flag)
				{
					tsourceToken3.insqlpluscmd = true;
				}
				tsourceToken3 = this.getanewsourcetoken();
				if (tsourceToken3 != null)
				{
					i = tsourceToken3.tokencode;
				}
				else
				{
					i = 0;
					if (flag3)
					{
						tsourceToken.tokencode = 273;
						if (tsourceToken.tokentype != ETokenType.ttslash)
						{
							tsourceToken.tokentype = ETokenType.ttsqlpluscmd;
						}
					}
				}
				if (i == 0 && tsourceToken2 != null && tsourceToken2.tokencode == 345)
				{
					tsourceToken2.tokencode = 264;
				}
			}
		}

		// Token: 0x060000D1 RID: 209 RVA: 0x0000A175 File Offset: 0x00008375
		internal virtual void doimpalatexttotokenlist()
		{
			this.dohivetexttotokenlist();
		}

		// Token: 0x060000D2 RID: 210 RVA: 0x0000A180 File Offset: 0x00008380
		internal virtual void checkMySQLCommentToken(TSourceToken cmtToken)
		{
			if (cmtToken.tokencode == 258 && cmtToken.ToString().StartsWith("--", StringComparison.Ordinal) && cmtToken.ToString().Length > 2 && cmtToken.ToString()[2] != ' ')
			{
				this.syntaxErrors.Add(new TSyntaxError(cmtToken.ToString(), cmtToken.lineNo, cmtToken.columnNo, "requires a space after the initial \"--\" ", EErrorType.sperror, 10010));
			}
		}

		// Token: 0x060000D3 RID: 211 RVA: 0x0000A1F8 File Offset: 0x000083F8
		internal virtual void domysqltexttotokenlist()
		{
			bool flag = false;
			this.flexer.tmpDelimiter = "";
			TSourceToken tsourceToken = this.getanewsourcetoken();
			if (tsourceToken == null)
			{
				return;
			}
			int i = tsourceToken.tokencode;
			this.checkMySQLCommentToken(tsourceToken);
			if (tsourceToken.tokencode == 536)
			{
				flag = true;
			}
			while (i > 0)
			{
				this.sourcetokenlist.add(tsourceToken);
				tsourceToken = this.getanewsourcetoken();
				if (tsourceToken == null)
				{
					break;
				}
				this.checkMySQLCommentToken(tsourceToken);
				if (tsourceToken.tokencode == 260 && flag)
				{
					flag = false;
					this.flexer.tmpDelimiter = this.sourcetokenlist.get(this.sourcetokenlist.size() - 1).astext;
				}
				if (tsourceToken.tokencode == 536)
				{
					flag = true;
				}
				if (tsourceToken.tokencode == 537)
				{
					TSourceToken tsourceToken2 = this.getprevsolidtoken(tsourceToken);
					if (tsourceToken2 != null && tsourceToken2.tokencode == 311)
					{
						tsourceToken2.tokencode = 279;
					}
				}
				i = tsourceToken.tokencode;
			}
		}

		// Token: 0x060000D4 RID: 212 RVA: 0x0000A2F0 File Offset: 0x000084F0
		internal virtual void doMdxtexttotokenlist()
		{
			TSourceToken tsourceToken = this.getanewsourcetoken();
			if (tsourceToken == null)
			{
				return;
			}
			for (int i = tsourceToken.tokencode; i > 0; i = tsourceToken.tokencode)
			{
				this.sourcetokenlist.add(tsourceToken);
				tsourceToken = this.getanewsourcetoken();
				if (tsourceToken == null)
				{
					break;
				}
			}
		}

		// Token: 0x060000D5 RID: 213 RVA: 0x0000A334 File Offset: 0x00008534
		internal virtual void dosqltexttotokenlist()
		{
			switch (this.dbVendor)
			{
			case EDbVendor.dbvdb2:
				this.dodb2sqltexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvgreenplum:
				this.dogreenplumtexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvhive:
				this.dohivetexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvimpala:
				this.doimpalatexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvinformix:
				this.doinformixtexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvmdx:
				this.doMdxtexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvmysql:
				this.domysqltexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvmssql:
				this.domssqlsqltexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvnetezza:
				this.donetezzatexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvoracle:
				this.dooraclesqltexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvpostgresql:
				this.dopostgresqltexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvredshift:
				this.doredshifttexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvsybase:
				this.dosybasesqltexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvteradata:
				this.doTeradatatexttotokenlist();
				goto IL_D7;
			case EDbVendor.dbvsnowflake:
				this.dosnowflaketexttotokenlist();
				goto IL_D7;
			}
			this.docommonsqltexttotokenlist();
			IL_D7:
			if (this.sourcetokenlist.size() > 0)
			{
				TSourceToken prevTokenInChain = null;
				for (int i = 0; i < this.sourcetokenlist.size(); i++)
				{
					this.sourcetokenlist.get(i).PrevTokenInChain = prevTokenInChain;
					if (i != this.sourcetokenlist.size() - 1)
					{
						this.sourcetokenlist.get(i).NextTokenInChain = this.sourcetokenlist.get(i + 1);
					}
					prevTokenInChain = this.sourcetokenlist.get(i);
				}
			}
		}

		// Token: 0x060000D6 RID: 214 RVA: 0x0000A48C File Offset: 0x0000868C
		internal virtual void doongetrawsqlstatementevent(TCustomSqlStatement pcsqlstatement)
		{
			pcsqlstatement.parser = this.fparser;
			pcsqlstatement.plsqlparser = this.fplsqlparser;
			pcsqlstatement.startToken = pcsqlstatement.sourcetokenlist.get(0);
			pcsqlstatement.endToken = pcsqlstatement.sourcetokenlist.get(pcsqlstatement.sourcetokenlist.size() - 1);
			this.sqlstatements.add(pcsqlstatement);
		}

		// Token: 0x060000D7 RID: 215 RVA: 0x0000A4F0 File Offset: 0x000086F0
		internal virtual int doredshiftgetrawsqlstatements()
		{
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							efindSqlStateType = EFindSqlStateType.stsql;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken2.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (this.sourcetokenlist.sqlplusaftercurtoken())
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000D8 RID: 216 RVA: 0x0000A808 File Offset: 0x00008A08
		internal virtual int dopostgresqlgetrawsqlstatements()
		{
			int num = 0;
			bool flag = false;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							if (this.gcurrentsqlstatement.ispgplsql())
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								flag = false;
								if (tsourceToken2.tokencode == 351 || tsourceToken2.tokencode == 479 || tsourceToken2.searchToken(479, 4) != null)
								{
									num = 1;
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken2.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (this.sourcetokenlist.sqlplusaftercurtoken())
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (tsourceToken2.tokencode == 351)
					{
						num++;
					}
					else if (tsourceToken2.tokencode == 305)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 316)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 490)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 313)
					{
						flag = true;
						num--;
						if (num < 0)
						{
							num = 0;
						}
					}
					if (tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (tsourceToken2.tokentype == ETokenType.ttperiod && this.sourcetokenlist.returnaftercurtoken(false) && this.sourcetokenlist.returnbeforecurtoken(false))
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon && num == 0 && flag && this.gcurrentsqlstatement.OracleStatementCanBeSeparatedByBeginEndPair())
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					if (tsourceToken2.tokencode == 273)
					{
						int num2 = TLexerPostgresql.getkeywordvalue(tsourceToken2.astext);
						if (num2 != 0)
						{
							tsourceToken2.tokencode = num2;
						}
						else
						{
							tsourceToken2.tokencode = 264;
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000D9 RID: 217 RVA: 0x0000AD84 File Offset: 0x00008F84
		internal virtual int dogreenplumgetrawsqlstatements()
		{
			int num = 0;
			bool flag = false;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							if (this.gcurrentsqlstatement.ispgplsql())
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								flag = false;
								if (tsourceToken2.tokencode == 351 || tsourceToken2.tokencode == 479 || tsourceToken2.searchToken(479, 4) != null)
								{
									num = 1;
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken2.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (this.sourcetokenlist.sqlplusaftercurtoken())
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (tsourceToken2.tokencode == 351)
					{
						num++;
					}
					else if (tsourceToken2.tokencode == 305)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 316)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 490)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 313)
					{
						flag = true;
						num--;
						if (num < 0)
						{
							num = 0;
						}
					}
					if (tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (tsourceToken2.tokentype == ETokenType.ttperiod && this.sourcetokenlist.returnaftercurtoken(false) && this.sourcetokenlist.returnbeforecurtoken(false))
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon && num == 0 && flag && this.gcurrentsqlstatement.OracleStatementCanBeSeparatedByBeginEndPair())
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					if (tsourceToken2.tokencode == 273)
					{
						int num2 = TLexerGreenplum.getkeywordvalue(tsourceToken2.astext);
						if (num2 != 0)
						{
							tsourceToken2.tokencode = num2;
						}
						else
						{
							tsourceToken2.tokencode = 264;
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000DA RID: 218 RVA: 0x0000B300 File Offset: 0x00009500
		private bool isTypeCastToken(TSourceToken ast)
		{
			bool result = false;
			TSourceToken tsourceToken = ast.searchToken(40, 1);
			if (tsourceToken != null)
			{
				result = (tsourceToken.searchToken(263, 1) == null);
			}
			return result;
		}

		// Token: 0x060000DB RID: 219 RVA: 0x0000B330 File Offset: 0x00009530
		internal virtual int donetezzagetrawsqlstatements()
		{
			int num = 0;
			bool flag = false;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken2.tokencode == 360)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 532;
					}
				}
				else if (tsourceToken2.tokencode == 361)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 533;
					}
				}
				else if (tsourceToken2.tokencode == 357)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 534;
					}
				}
				else if (tsourceToken2.tokencode == 367)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 535;
					}
				}
				else if (tsourceToken2.tokencode == 374)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 536;
					}
				}
				else if (tsourceToken2.tokencode == 368)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 537;
					}
				}
				else if (tsourceToken2.tokencode == 372)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 538;
					}
				}
				else if (tsourceToken2.tokencode == 355)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 540;
					}
				}
				else if (tsourceToken2.tokencode == 379)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 541;
					}
				}
				else if (tsourceToken2.tokencode == 380)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 542;
					}
				}
				else if (tsourceToken2.tokencode == 382)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 543;
					}
				}
				else if (tsourceToken2.tokencode == 381)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 544;
					}
				}
				else if (tsourceToken2.tokencode == 394)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 545;
					}
				}
				else if (tsourceToken2.tokencode == 393)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 546;
					}
				}
				else if (tsourceToken2.tokencode == 395)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 547;
					}
				}
				else if (tsourceToken2.tokencode == 416)
				{
					if (this.isTypeCastToken(tsourceToken2))
					{
						tsourceToken2.tokencode = 548;
					}
				}
				else if (tsourceToken2.tokencode == 375 && this.isTypeCastToken(tsourceToken2))
				{
					tsourceToken2.tokencode = 549;
				}
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							if (this.gcurrentsqlstatement.isnzplsql())
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								flag = false;
								if (tsourceToken2.tokencode == 351 || tsourceToken2.tokencode == 479 || tsourceToken2.searchToken(479, 4) != null)
								{
									num = 1;
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken2.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (this.sourcetokenlist.sqlplusaftercurtoken())
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (tsourceToken2.tokencode == 351)
					{
						num++;
					}
					else if (tsourceToken2.tokencode == 305)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 316)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 490)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 313)
					{
						flag = true;
						num--;
						if (num < 0)
						{
							num = 0;
						}
					}
					if (tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (tsourceToken2.tokentype == ETokenType.ttperiod && this.sourcetokenlist.returnaftercurtoken(false) && this.sourcetokenlist.returnbeforecurtoken(false))
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon && num == 0 && flag && this.gcurrentsqlstatement.OracleStatementCanBeSeparatedByBeginEndPair())
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					if (tsourceToken2.tokencode == 273)
					{
						int num2 = TLexerNetezza.getkeywordvalue(tsourceToken2.astext);
						if (num2 != 0)
						{
							tsourceToken2.tokencode = num2;
						}
						else
						{
							tsourceToken2.tokencode = 264;
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000DC RID: 220 RVA: 0x0000BB80 File Offset: 0x00009D80
		internal virtual int dooraclegetrawsqlstatements()
		{
			int[] array = new int[1024];
			TGSharpSqlParser.stored_procedure_type[] array2 = new TGSharpSqlParser.stored_procedure_type[1024];
			TGSharpSqlParser.stored_procedure_status[] array3 = new TGSharpSqlParser.stored_procedure_status[1024];
			bool flag = true;
			int num = 0;
			int num2 = 0;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken2.tokencode == 427)
				{
					if (tsourceToken2.searchToken(317, 1) != null)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				else if (tsourceToken2.tokencode == 548)
				{
					if (tsourceToken2.searchToken(340, -1) == null)
					{
						tsourceToken2.tokencode = 264;
					}
					else
					{
						tsourceToken2.tokencode = 547;
					}
				}
				else if (tsourceToken2.tokencode == 549)
				{
					if (tsourceToken2.searchToken(41, -1) != null)
					{
						tsourceToken2.tokencode = 264;
					}
					TSourceToken tsourceToken3 = tsourceToken2.searchToken(46, 1);
					if (tsourceToken3 != null)
					{
						tsourceToken2.tokencode = 264;
					}
					TSourceToken tsourceToken4 = tsourceToken2.searchTokenAfterObjectName();
					if (tsourceToken3 == null && tsourceToken4 != null && tsourceToken4.tokencode == 40)
					{
						tsourceToken2.tokencode = 558;
					}
				}
				else if (tsourceToken2.tokencode == 550)
				{
					if (tsourceToken2.searchToken(40, 1) == null)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				else if (tsourceToken2.tokencode == 552)
				{
					bool flag2 = tsourceToken2.searchToken(551, 1) != null;
					TSourceToken tsourceToken5 = tsourceToken2.searchToken(310, -1);
					if (tsourceToken5 == null)
					{
						tsourceToken5 = tsourceToken2.searchToken(559, -1);
					}
					if (!flag2 && tsourceToken5 == null)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				else if (tsourceToken2.tokencode == 303)
				{
					if (tsourceToken2.searchToken(46, -1) != null)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				else if (tsourceToken2.tokencode == 554)
				{
					TSourceToken tsourceToken6 = tsourceToken2.searchToken(428, -1);
					if (tsourceToken6 != null)
					{
						tsourceToken6.tokencode = 553;
					}
				}
				else if (tsourceToken2.tokencode == 555)
				{
					TSourceToken tsourceToken7 = tsourceToken2.searchToken(347, -1);
					if (tsourceToken7 != null)
					{
						tsourceToken7.tokencode = 281;
					}
				}
				else if (tsourceToken2.tokencode == 556)
				{
					if (tsourceToken2.searchToken("(", 2) != null)
					{
						tsourceToken2.tokencode = 557;
					}
				}
				else if (tsourceToken2.tokencode == 513)
				{
					if (tsourceToken2.searchToken("key", 1) == null)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				else if (tsourceToken2.tokencode == 515)
				{
					TSourceToken tsourceToken8 = tsourceToken2.nextSolidToken();
					if (tsourceToken8 == null)
					{
						tsourceToken2.tokencode = 264;
					}
					else if (tsourceToken8.tokencode != 264)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							if (this.gcurrentsqlstatement.isoracleplsql())
							{
								num = 0;
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype != ESqlStatementType.sst_block_with_label)
								{
									switch (sqlstatementtype)
									{
									case ESqlStatementType.sstplsql_createprocedure:
										array2[num] = TGSharpSqlParser.stored_procedure_type.procedure;
										goto IL_54B;
									case ESqlStatementType.sstplsql_createfunction:
										array2[num] = TGSharpSqlParser.stored_procedure_type.function;
										goto IL_54B;
									case ESqlStatementType.sstplsql_createpackage:
										array2[num] = TGSharpSqlParser.stored_procedure_type.package_spec;
										if (tsourceToken2.searchToken(526, 5) != null)
										{
											array2[num] = TGSharpSqlParser.stored_procedure_type.package_body;
											goto IL_54B;
										}
										goto IL_54B;
									case ESqlStatementType.sstplsql_createtrigger:
										array2[num] = TGSharpSqlParser.stored_procedure_type.create_trigger;
										goto IL_54B;
									case ESqlStatementType.sstplsql_createtype:
										break;
									case ESqlStatementType.sstplsql_createtype_placeholder:
										efindSqlStateType = EFindSqlStateType.stsql;
										goto IL_54B;
									default:
										if (sqlstatementtype == ESqlStatementType.sstoraclecreatelibrary)
										{
											array2[num] = TGSharpSqlParser.stored_procedure_type.create_library;
											goto IL_54B;
										}
										break;
									}
									array2[num] = TGSharpSqlParser.stored_procedure_type.others;
								}
								else
								{
									array2[num] = TGSharpSqlParser.stored_procedure_type.block_with_declare;
									if (tsourceToken2.tokencode == 351)
									{
										array2[num] = TGSharpSqlParser.stored_procedure_type.block_with_begin;
									}
								}
								IL_54B:
								if (array2[0] == TGSharpSqlParser.stored_procedure_type.block_with_declare)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.is_as;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.block_with_begin)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.body;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.procedure)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.start;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.function)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.start;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.package_spec)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.start;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.package_body)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.start;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.create_trigger)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.start;
								}
								else if (array2[0] == TGSharpSqlParser.stored_procedure_type.create_library)
								{
									flag = false;
									array3[0] = TGSharpSqlParser.stored_procedure_status.bodyend;
								}
								else
								{
									flag = true;
									array3[0] = TGSharpSqlParser.stored_procedure_status.bodyend;
								}
								if (tsourceToken2.tokencode == 351 || tsourceToken2.tokencode == 479 || tsourceToken2.searchToken(479, 4) != null)
								{
									array[num] = 1;
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								num2 = 0;
							}
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken2.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (this.sourcetokenlist.sqlplusaftercurtoken())
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						if (tsourceToken2.tokencode == 40)
						{
							num2++;
						}
						if (tsourceToken2.tokencode == 41)
						{
							num2--;
							if (num2 < 0)
							{
								num2 = 0;
							}
						}
						bool flag3 = false;
						TCustomSqlStatement tcustomSqlStatement = null;
						if (num2 == 0 && (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstcreatetable || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstcreateindex || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstoracleanalyze || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstTruncate))
						{
							tcustomSqlStatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
							if (tcustomSqlStatement != null)
							{
								flag3 = true;
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstselect)
								{
									TSourceToken tsourceToken9 = tsourceToken2.prevSolidToken();
									if (tsourceToken9.tokencode == 341 || tsourceToken9.tokencode == 40)
									{
										flag3 = false;
									}
								}
							}
						}
						if (flag3)
						{
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = tcustomSqlStatement;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (array3[num] != TGSharpSqlParser.stored_procedure_status.bodyend)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					switch (array3[num])
					{
					case TGSharpSqlParser.stored_procedure_status.start:
						if (tsourceToken2.tokencode == 341 || tsourceToken2.tokencode == 525)
						{
							if (array2[num] != TGSharpSqlParser.stored_procedure_type.create_trigger && (array2[0] != TGSharpSqlParser.stored_procedure_type.package_spec || num <= 0))
							{
								array3[num] = TGSharpSqlParser.stored_procedure_status.is_as;
								if (tsourceToken2.searchToken("language", 1) != null)
								{
									if (num == 0)
									{
										efindSqlStateType = EFindSqlStateType.stsql;
									}
									else
									{
										array3[num] = TGSharpSqlParser.stored_procedure_status.body;
										num--;
									}
								}
							}
						}
						else if (tsourceToken2.tokencode == 351)
						{
							if (array2[num] == TGSharpSqlParser.stored_procedure_type.create_trigger)
							{
								array[num]++;
							}
							if (num > 0)
							{
								num--;
							}
							array3[num] = TGSharpSqlParser.stored_procedure_status.body;
						}
						else if (tsourceToken2.tokencode == 313)
						{
							if (num > 0 && array[num - 1] == 1 && (array2[num - 1] == TGSharpSqlParser.stored_procedure_type.package_body || array2[num - 1] == TGSharpSqlParser.stored_procedure_type.package_spec))
							{
								num--;
								array3[num] = TGSharpSqlParser.stored_procedure_status.bodyend;
							}
						}
						else if (tsourceToken2.tokencode == 477 || tsourceToken2.tokencode == 478)
						{
							if (num > 0 && array[num] == 0 && array3[num - 1] == TGSharpSqlParser.stored_procedure_status.is_as)
							{
								num--;
								num++;
								array[num] = 0;
								array3[num] = TGSharpSqlParser.stored_procedure_status.start;
							}
						}
						else if (array2[num] == TGSharpSqlParser.stored_procedure_type.create_trigger && tsourceToken2.tokencode == 315)
						{
							array3[num] = TGSharpSqlParser.stored_procedure_status.is_as;
						}
						else if (array2[num] == TGSharpSqlParser.stored_procedure_type.create_trigger && tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
						{
							tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (array2[num] == TGSharpSqlParser.stored_procedure_type.create_trigger && tsourceToken2.tokencode == 545 && tsourceToken2.searchToken(560, -1) != null)
						{
							array3[num] = TGSharpSqlParser.stored_procedure_status.body;
							array[num]++;
						}
						break;
					case TGSharpSqlParser.stored_procedure_status.is_as:
						if (tsourceToken2.tokencode == 477 || tsourceToken2.tokencode == 478)
						{
							num++;
							array[num] = 0;
							array3[num] = TGSharpSqlParser.stored_procedure_status.start;
							if (num > 1023)
							{
								efindSqlStateType = EFindSqlStateType.sterror;
								num--;
							}
						}
						else if (tsourceToken2.tokencode == 351)
						{
							if (num != 0 || (array2[num] != TGSharpSqlParser.stored_procedure_type.package_body && array2[num] != TGSharpSqlParser.stored_procedure_type.package_spec))
							{
								array[num]++;
							}
							array3[num] = TGSharpSqlParser.stored_procedure_status.body;
						}
						else if (tsourceToken2.tokencode == 313)
						{
							if (num == 0 && array[num] == 1 && (array2[num] == TGSharpSqlParser.stored_procedure_type.package_body || array2[num] == TGSharpSqlParser.stored_procedure_type.package_spec))
							{
								array3[num] = TGSharpSqlParser.stored_procedure_status.bodyend;
								array[num]--;
							}
							else
							{
								array[num]--;
							}
						}
						else if (tsourceToken2.tokencode == 316 && tsourceToken2.searchToken(59, 1) == null)
						{
							array[num]++;
						}
						break;
					case TGSharpSqlParser.stored_procedure_status.body:
						if (tsourceToken2.tokencode == 351)
						{
							array[num]++;
						}
						else if (tsourceToken2.tokencode == 305)
						{
							if (tsourceToken2.searchToken(59, 2) == null)
							{
								array[num]++;
							}
						}
						else if (tsourceToken2.tokencode == 316)
						{
							if (tsourceToken2.searchToken(59, 2) == null && tsourceToken2.searchToken(313, -1) == null)
							{
								array[num]++;
							}
						}
						else if (tsourceToken2.tokencode == 490)
						{
							if (tsourceToken2.searchToken(313, -1) == null || tsourceToken2.searchToken(59, 2) == null)
							{
								array[num]++;
							}
						}
						else if (tsourceToken2.tokencode == 313)
						{
							array[num]--;
							if (array[num] == 0)
							{
								if (num == 0)
								{
									array3[num] = TGSharpSqlParser.stored_procedure_status.bodyend;
								}
								else
								{
									num--;
									array3[num] = TGSharpSqlParser.stored_procedure_status.is_as;
								}
							}
						}
						else if (array[num] == 0 && tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
						{
							tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						break;
					case TGSharpSqlParser.stored_procedure_status.bodyend:
						if (tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
						{
							tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.tokentype == ETokenType.ttperiod && this.sourcetokenlist.returnaftercurtoken(false) && this.sourcetokenlist.returnbeforecurtoken(false))
						{
							tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(479, 1) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(477, 1) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(478, 1) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(307, 1) != null && tsourceToken2.searchToken(479, 4) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(307, 1) != null && tsourceToken2.searchToken(546, 4) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(426, 1) != null && tsourceToken2.searchToken(545, 2) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else if (tsourceToken2.searchToken(301, 1) != null && !flag)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						break;
					}
					if (tsourceToken2.tokencode == 273)
					{
						int num3 = TLexerOracle.getkeywordvalue(tsourceToken2.astext);
						if (num3 != 0)
						{
							tsourceToken2.tokencode = num3;
						}
						else if (tsourceToken2.tokentype == ETokenType.ttslash)
						{
							tsourceToken2.tokencode = 47;
						}
						else
						{
							tsourceToken2.tokencode = 264;
						}
					}
					if (tsourceToken2.tokencode == 535 && tsourceToken2.posinlist - this.gcurrentsqlstatement.sourcetokenlist.get(0).posinlist < 20)
					{
						if (this.gcurrentsqlstatement is TCommonStoredProcedureSqlStatement)
						{
							((TCommonStoredProcedureSqlStatement)this.gcurrentsqlstatement).Wrapped = true;
						}
						if (this.gcurrentsqlstatement is TPlsqlCreatePackage && tsourceToken2.prevSolidToken() != null)
						{
							((TPlsqlCreatePackage)this.gcurrentsqlstatement).PackageName = this.fparser.NodeFactory.createObjectNameWithPart(tsourceToken2.prevSolidToken());
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000DD RID: 221 RVA: 0x0000CBFC File Offset: 0x0000ADFC
		internal virtual int domdxgetrawsqlstatements()
		{
			int num = 0;
			bool flag = false;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmdxscope)
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								flag = false;
								num = 1;
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (tsourceToken2.tokencode == 305)
					{
						num++;
					}
					else if (tsourceToken2.tokencode == 316)
					{
						num++;
					}
					else if (tsourceToken2.tokencode == 524)
					{
						if (tsourceToken.tokencode != 313)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 313)
					{
						flag = true;
						num--;
						if (num < 0)
						{
							num = 0;
						}
					}
					this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon && num == 0 && flag)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000DE RID: 222 RVA: 0x0000CF70 File Offset: 0x0000B170
		internal virtual int dosnowflakegetrawsqlstatements()
		{
			int num = 0;
			bool flag = false;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken2.tokencode == 344 || tsourceToken2.tokencode == 343)
				{
					if (tsourceToken2.searchToken(40, 1) != null)
					{
						tsourceToken2.tokencode = 264;
					}
				}
				else if (tsourceToken2.tokencode == 538 && tsourceToken2.searchToken(40, 1) != null)
				{
					tsourceToken2.tokencode = 539;
				}
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							if (this.gcurrentsqlstatement.ispgplsql())
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								flag = false;
								if (tsourceToken2.tokencode == 351 || tsourceToken2.tokencode == 479 || tsourceToken2.searchToken(479, 4) != null)
								{
									num = 1;
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken2.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (this.sourcetokenlist.sqlplusaftercurtoken())
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (tsourceToken2.tokencode == 351)
					{
						num++;
					}
					else if (tsourceToken2.tokencode == 305)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 316)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 490)
					{
						if (tsourceToken2.searchToken(313, -1) == null)
						{
							num++;
						}
					}
					else if (tsourceToken2.tokencode == 313)
					{
						flag = true;
						num--;
						if (num < 0)
						{
							num = 0;
						}
					}
					if (tsourceToken2.tokentype == ETokenType.ttslash && tsourceToken2.tokencode == 273)
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (tsourceToken2.tokentype == ETokenType.ttperiod && this.sourcetokenlist.returnaftercurtoken(false) && this.sourcetokenlist.returnbeforecurtoken(false))
					{
						tsourceToken2.tokenstatus = ETokenStatus.tsignorebyyacc;
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon && num == 0 && flag && this.gcurrentsqlstatement.OracleStatementCanBeSeparatedByBeginEndPair())
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					if (tsourceToken2.tokencode == 273)
					{
						int num2 = TLexerSnowflake.getkeywordvalue(tsourceToken2.astext);
						if (num2 != 0)
						{
							tsourceToken2.tokencode = num2;
						}
						else
						{
							tsourceToken2.tokencode = 264;
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000DF RID: 223 RVA: 0x0000D548 File Offset: 0x0000B748
		internal virtual int doimpalagetrawsqlstatements()
		{
			return this.dohivegetrawsqlstatements();
		}

		// Token: 0x060000E0 RID: 224 RVA: 0x0000D550 File Offset: 0x0000B750
		internal virtual int dohivegetrawsqlstatements()
		{
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (this.gcurrentsqlstatement != null)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (this.gcurrentsqlstatement != null)
						{
							efindSqlStateType = EFindSqlStateType.stsql;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else
						{
							this.syntaxErrors.Add(new TSyntaxError(tsourceToken2.astext, tsourceToken2.lineNo, (tsourceToken2.columnNo < 0L) ? 0L : tsourceToken2.columnNo, "Error when tokenlize", EErrorType.spwarning, 10200));
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				}
			}
			if (this.gcurrentsqlstatement != null && (efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return this.syntaxErrors.Count;
		}

		// Token: 0x060000E1 RID: 225 RVA: 0x0000D7D0 File Offset: 0x0000B9D0
		internal virtual int dosybasegetrawsqlstatements()
		{
			int result = 0;
			int num = 0;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			int num2 = 0;
			int num3 = 0;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken2.tokenstatus == ETokenStatus.tsignoredbygetrawstatement)
				{
					this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
				}
				else if (efindSqlStateType == EFindSqlStateType.ststoredprocedurebody && tsourceToken2.tokencode != 463 && tsourceToken2.tokencode != 307 && tsourceToken2.tokencode != 426)
				{
					this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
				}
				else
				{
					TCustomSqlStatement tcustomSqlStatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
					switch (efindSqlStateType)
					{
					case EFindSqlStateType.stnormal:
						if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							if (TBaseType.assigned(this.gcurrentsqlstatement))
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							if (TBaseType.assigned(tsourceToken) && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
							{
								tsourceToken2.tokentype = ETokenType.ttsimplecomment;
								tsourceToken2.tokencode = 258;
							}
						}
						else
						{
							this.gcurrentsqlstatement = tcustomSqlStatement;
							if (TBaseType.assigned(this.gcurrentsqlstatement))
							{
								ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype - ESqlStatementType.sstmssqlcreateprocedure > 5)
								{
									if (sqlstatementtype != ESqlStatementType.sstmssqlgo)
									{
										if (sqlstatementtype - ESqlStatementType.sstmssqlbegintry > 1)
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqllabel)
											{
												this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
												efindSqlStateType = EFindSqlStateType.stnormal;
											}
											else
											{
												efindSqlStateType = EFindSqlStateType.stsql;
											}
										}
										else
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											efindSqlStateType = EFindSqlStateType.sttrycatch;
											num3 = 0;
										}
									}
									else
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
										efindSqlStateType = EFindSqlStateType.stnormal;
									}
								}
								else
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								}
							}
							else if (tsourceToken2.tokencode == 351)
							{
								this.gcurrentsqlstatement = new TMssqlBlock(this.dbVendor);
								this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstmssqlblock;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.stblock;
							}
							else if (this.sqlstatements.size() == 0)
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement = new TMssqlExecute(this.dbVendor);
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							else if (this.sqlstatements.get(this.sqlstatements.size() - 1).sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement = new TMssqlExecute(this.dbVendor);
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							if (!TBaseType.assigned(this.gcurrentsqlstatement))
							{
								this.errormessage = string.Concat(new string[]
								{
									"error when tokenlize:",
									tsourceToken2.astext,
									"(",
									tsourceToken2.lineNo.ToString(),
									",",
									tsourceToken2.columnNo.ToString(),
									")"
								});
								result = 1;
								tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
								efindSqlStateType = EFindSqlStateType.sterror;
								this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
								this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						break;
					case EFindSqlStateType.stsql:
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							bool flag = false;
							if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif)
							{
								TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
								if (TBaseType.assigned(tsourceToken3) && tsourceToken3.tokencode == 349)
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									flag = true;
								}
							}
							if (!flag)
							{
								efindSqlStateType = EFindSqlStateType.stnormal;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.gcurrentsqlstatement.semicolonended = tsourceToken2;
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							}
						}
						else if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else
							{
								ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype <= ESqlStatementType.sstmssqlalterqueue)
								{
									if (sqlstatementtype != ESqlStatementType.sstmssqlif)
									{
										if (sqlstatementtype != ESqlStatementType.sstmssqlalterqueue)
										{
											goto IL_900;
										}
										if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlexec)
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											break;
										}
										goto IL_900;
									}
								}
								else
								{
									if (sqlstatementtype == ESqlStatementType.sstmssqlcreateschema)
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										break;
									}
									if (sqlstatementtype != ESqlStatementType.sstmssqlwhile)
									{
										goto IL_900;
									}
								}
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegincatch || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegintry)
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									efindSqlStateType = EFindSqlStateType.stblock;
									num2 = 1;
									break;
								}
								if (this.gcurrentsqlstatement.stmtDummyTag == 1)
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlif || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile)
									{
										this.gcurrentsqlstatement.stmtDummyTag = 1;
									}
									else
									{
										this.gcurrentsqlstatement.stmtDummyTag = 0;
									}
									break;
								}
								IL_900:
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype - ESqlStatementType.sstmssqlcreateprocedure > 5)
								{
									if (sqlstatementtype != ESqlStatementType.sstmssqlgo)
									{
										if (sqlstatementtype - ESqlStatementType.sstmssqlbegintry > 1)
										{
											efindSqlStateType = EFindSqlStateType.stsql;
										}
										else
										{
											efindSqlStateType = EFindSqlStateType.sttrycatch;
											num3 = 0;
										}
									}
									else
									{
										efindSqlStateType = EFindSqlStateType.stnormal;
									}
								}
								else
								{
									efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								}
							}
						}
						else if (tsourceToken2.tokencode == 351)
						{
							if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile)
							{
								efindSqlStateType = EFindSqlStateType.stblock;
								num2 = 0;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							else if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqldeclare)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = new TMssqlBlock(this.dbVendor);
								this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstmssqlblock;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.stblock;
							}
							else
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else if (tsourceToken2.tokencode == 316)
						{
							num++;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else if (tsourceToken2.tokencode == 313)
						{
							if (num > 0)
							{
								num--;
							}
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else if (tsourceToken2.tokencode == 349)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if ((this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile) && num == 0)
							{
								this.gcurrentsqlstatement.stmtDummyTag = 1;
							}
						}
						else
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlset && tsourceToken2.tokencode == 323)
							{
								efindSqlStateType = EFindSqlStateType.stnormal;
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							}
						}
						break;
					case EFindSqlStateType.ststoredprocedure:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedurebody;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						if (efindSqlStateType == EFindSqlStateType.ststoredprocedure)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if (tsourceToken2.tokencode == 351)
							{
								efindSqlStateType = EFindSqlStateType.stblock;
							}
						}
						break;
					case EFindSqlStateType.sterror:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = tcustomSqlStatement;
							this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stsql;
						}
						else if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							efindSqlStateType = EFindSqlStateType.stnormal;
						}
						else
						{
							this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						}
						break;
					case EFindSqlStateType.stblock:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
						}
						if (efindSqlStateType == EFindSqlStateType.stblock)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if (tsourceToken2.tokencode == 351)
							{
								TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
								if (TBaseType.assigned(tsourceToken3))
								{
									if (!TBaseType.mysametext(tsourceToken3.astext, "tran") && !TBaseType.mysametext(tsourceToken3.astext, "transaction") && !TBaseType.mysametext(tsourceToken3.astext, "distributed") && !TBaseType.mysametext(tsourceToken3.astext, "dialog") && !TBaseType.mysametext(tsourceToken3.astext, "conversation"))
									{
										num2++;
									}
								}
								else
								{
									num2++;
								}
							}
							else if (tsourceToken2.tokencode == 316)
							{
								num2++;
							}
							else if (tsourceToken2.tokencode == 313)
							{
								bool flag2 = false;
								TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
								if (TBaseType.assigned(tsourceToken3) && tsourceToken3.tokencode == TLexerSybase.getkeywordvalue("conversation".ToUpper()))
								{
									flag2 = true;
								}
								if (!flag2)
								{
									if (num2 == 0)
									{
										if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif && TBaseType.assigned(tsourceToken3))
										{
											if (tsourceToken3.tokencode == 349)
											{
												efindSqlStateType = EFindSqlStateType.stsql;
											}
											else if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
											{
												TSourceToken tsourceToken4 = this.sourcetokenlist.nextsolidtoken(tsourceToken3.posinlist, 1, false);
												if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 349)
												{
													efindSqlStateType = EFindSqlStateType.stsql;
												}
											}
										}
										if (efindSqlStateType != EFindSqlStateType.stsql)
										{
											this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
											efindSqlStateType = EFindSqlStateType.stnormal;
										}
									}
									else
									{
										num2--;
									}
								}
							}
						}
						break;
					case EFindSqlStateType.sttrycatch:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegintry || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegincatch)
							{
								num3++;
							}
						}
						if (efindSqlStateType == EFindSqlStateType.sttrycatch)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if ((tsourceToken2.tokencode == 456 || tsourceToken2.tokencode == 462) && TBaseType.assigned(tsourceToken) && tsourceToken.tokencode == 313)
							{
								if (num3 == 0)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
								else
								{
									num3--;
								}
							}
						}
						break;
					case EFindSqlStateType.ststoredprocedurebody:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							ESqlStatementType sqlstatementtype = tcustomSqlStatement.sqlstatementtype;
							if (sqlstatementtype - ESqlStatementType.sstmssqlcreateprocedure > 5)
							{
								if (sqlstatementtype == ESqlStatementType.sstmssqlgo)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
							}
							else
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
							}
						}
						if (efindSqlStateType == EFindSqlStateType.ststoredprocedurebody)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						break;
					}
				}
			}
			if (TBaseType.assigned(this.gcurrentsqlstatement) && efindSqlStateType != EFindSqlStateType.stnormal)
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return result;
		}

		// Token: 0x060000E2 RID: 226 RVA: 0x0000E41C File Offset: 0x0000C61C
		internal virtual int doinformixgetrawsqlstatements()
		{
			int result = 0;
			int num = 0;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			int num2 = 0;
			int num3 = 0;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken2.tokenstatus == ETokenStatus.tsignoredbygetrawstatement)
				{
					this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
				}
				else if (efindSqlStateType == EFindSqlStateType.ststoredprocedurebody && tsourceToken2.tokencode != 463 && tsourceToken2.tokencode != 307 && tsourceToken2.tokencode != 426)
				{
					this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
				}
				else
				{
					TCustomSqlStatement tcustomSqlStatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
					switch (efindSqlStateType)
					{
					case EFindSqlStateType.stnormal:
						if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							if (TBaseType.assigned(this.gcurrentsqlstatement))
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							if (TBaseType.assigned(tsourceToken) && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
							{
								tsourceToken2.tokentype = ETokenType.ttsimplecomment;
								tsourceToken2.tokencode = 258;
							}
						}
						else
						{
							this.gcurrentsqlstatement = tcustomSqlStatement;
							if (TBaseType.assigned(this.gcurrentsqlstatement))
							{
								ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype <= ESqlStatementType.sstinformixAlterProcedure)
								{
									if (sqlstatementtype <= ESqlStatementType.sstmssqlbegincatch)
									{
										if (sqlstatementtype == ESqlStatementType.sstmssqlgo)
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
											efindSqlStateType = EFindSqlStateType.stnormal;
											goto IL_3EC;
										}
										if (sqlstatementtype - ESqlStatementType.sstmssqlbegintry <= 1)
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											efindSqlStateType = EFindSqlStateType.sttrycatch;
											num3 = 0;
											goto IL_3EC;
										}
									}
									else if (sqlstatementtype == ESqlStatementType.sstinformixAlterFunction || sqlstatementtype == ESqlStatementType.sstinformixAlterProcedure)
									{
										goto IL_2D9;
									}
								}
								else if (sqlstatementtype <= ESqlStatementType.sstinformixCreateProcedure)
								{
									if (sqlstatementtype == ESqlStatementType.sstinformixCreateFunction || sqlstatementtype == ESqlStatementType.sstinformixCreateProcedure)
									{
										goto IL_2D9;
									}
								}
								else
								{
									if (sqlstatementtype == ESqlStatementType.sstinformixCreateTrigger)
									{
										goto IL_2D9;
									}
									if (sqlstatementtype == ESqlStatementType.sstinformixExecute)
									{
										efindSqlStateType = EFindSqlStateType.stExec;
										goto IL_3EC;
									}
								}
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.stsql;
								goto IL_3EC;
								IL_2D9:
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
							}
							else if (tsourceToken2.tokencode == 351)
							{
								this.gcurrentsqlstatement = new TMssqlBlock(this.dbVendor);
								this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstmssqlblock;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.stblock;
							}
							else if (this.sqlstatements.size() == 0)
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement = new TMssqlExecute(this.dbVendor);
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							else if (this.sqlstatements.get(this.sqlstatements.size() - 1).sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement = new TMssqlExecute(this.dbVendor);
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							IL_3EC:
							if (!TBaseType.assigned(this.gcurrentsqlstatement))
							{
								this.errormessage = string.Concat(new string[]
								{
									"error when tokenlize:",
									tsourceToken2.astext,
									"(",
									tsourceToken2.lineNo.ToString(),
									",",
									tsourceToken2.columnNo.ToString(),
									")"
								});
								result = 1;
								tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
								efindSqlStateType = EFindSqlStateType.sterror;
								this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
								this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						break;
					case EFindSqlStateType.stsql:
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							bool flag = false;
							if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif)
							{
								TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
								if (TBaseType.assigned(tsourceToken3) && tsourceToken3.tokencode == 349)
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									flag = true;
								}
							}
							if (!flag)
							{
								efindSqlStateType = EFindSqlStateType.stnormal;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.gcurrentsqlstatement.semicolonended = tsourceToken2;
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							}
						}
						else if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else
							{
								ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype <= ESqlStatementType.sstmssqlalterqueue)
								{
									if (sqlstatementtype != ESqlStatementType.sstmssqlif)
									{
										if (sqlstatementtype != ESqlStatementType.sstmssqlalterqueue)
										{
											goto IL_971;
										}
										if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlexec)
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											break;
										}
										goto IL_971;
									}
								}
								else
								{
									if (sqlstatementtype == ESqlStatementType.sstmssqlcreateschema)
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										break;
									}
									if (sqlstatementtype != ESqlStatementType.sstmssqlwhile)
									{
										goto IL_971;
									}
								}
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegincatch || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegintry)
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									efindSqlStateType = EFindSqlStateType.stblock;
									num2 = 1;
									break;
								}
								if (this.gcurrentsqlstatement.stmtDummyTag == 1)
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlif || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile)
									{
										this.gcurrentsqlstatement.stmtDummyTag = 1;
									}
									else
									{
										this.gcurrentsqlstatement.stmtDummyTag = 0;
									}
									break;
								}
								IL_971:
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
								if (sqlstatementtype <= ESqlStatementType.sstinformixAlterFunction)
								{
									if (sqlstatementtype == ESqlStatementType.sstmssqlgo)
									{
										efindSqlStateType = EFindSqlStateType.stnormal;
										break;
									}
									if (sqlstatementtype - ESqlStatementType.sstmssqlbegintry <= 1)
									{
										efindSqlStateType = EFindSqlStateType.sttrycatch;
										num3 = 0;
										break;
									}
									if (sqlstatementtype != ESqlStatementType.sstinformixAlterFunction)
									{
										goto IL_A0B;
									}
								}
								else if (sqlstatementtype <= ESqlStatementType.sstinformixCreateFunction)
								{
									if (sqlstatementtype != ESqlStatementType.sstinformixAlterProcedure && sqlstatementtype != ESqlStatementType.sstinformixCreateFunction)
									{
										goto IL_A0B;
									}
								}
								else if (sqlstatementtype != ESqlStatementType.sstinformixCreateProcedure && sqlstatementtype != ESqlStatementType.sstinformixCreateTrigger)
								{
									goto IL_A0B;
								}
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								break;
								IL_A0B:
								efindSqlStateType = EFindSqlStateType.stsql;
							}
						}
						else if (tsourceToken2.tokencode == 351)
						{
							if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile)
							{
								efindSqlStateType = EFindSqlStateType.stblock;
								num2 = 0;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							else if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqldeclare)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = new TMssqlBlock(this.dbVendor);
								this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstmssqlblock;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.stblock;
							}
							else
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						else if (tsourceToken2.tokencode == 316)
						{
							num++;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else if (tsourceToken2.tokencode == 313)
						{
							if (num > 0)
							{
								num--;
							}
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						else if (tsourceToken2.tokencode == 349)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if ((this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile) && num == 0)
							{
								this.gcurrentsqlstatement.stmtDummyTag = 1;
							}
						}
						else
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						break;
					case EFindSqlStateType.ststoredprocedure:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedurebody;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						if (efindSqlStateType == EFindSqlStateType.ststoredprocedure)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if ((tsourceToken2.tokencode == 477 || tsourceToken2.tokencode == 478) && tsourceToken2.searchToken(313, -1) != null)
							{
								efindSqlStateType = EFindSqlStateType.stsql;
							}
						}
						break;
					case EFindSqlStateType.sterror:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = tcustomSqlStatement;
							this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stsql;
						}
						else if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							efindSqlStateType = EFindSqlStateType.stnormal;
						}
						else
						{
							this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						}
						break;
					case EFindSqlStateType.stblock:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
						}
						if (efindSqlStateType == EFindSqlStateType.stblock)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if (tsourceToken2.tokencode == 351)
							{
								TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
								if (TBaseType.assigned(tsourceToken3))
								{
									if (!TBaseType.mysametext(tsourceToken3.astext, "tran") && !TBaseType.mysametext(tsourceToken3.astext, "transaction") && !TBaseType.mysametext(tsourceToken3.astext, "distributed") && !TBaseType.mysametext(tsourceToken3.astext, "dialog") && !TBaseType.mysametext(tsourceToken3.astext, "conversation"))
									{
										num2++;
									}
								}
								else
								{
									num2++;
								}
							}
							else if (tsourceToken2.tokencode == 316)
							{
								num2++;
							}
							else if (tsourceToken2.tokencode == 313)
							{
								bool flag2 = false;
								TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
								if (TBaseType.assigned(tsourceToken3) && tsourceToken3.tokencode == TLexerInformix.getkeywordvalue("conversation".ToUpper()))
								{
									flag2 = true;
								}
								if (!flag2)
								{
									if (num2 == 0)
									{
										if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif && TBaseType.assigned(tsourceToken3))
										{
											if (tsourceToken3.tokencode == 349)
											{
												efindSqlStateType = EFindSqlStateType.stsql;
											}
											else if (tsourceToken3.tokentype == ETokenType.ttsemicolon)
											{
												TSourceToken tsourceToken4 = this.sourcetokenlist.nextsolidtoken(tsourceToken3.posinlist, 1, false);
												if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 349)
												{
													efindSqlStateType = EFindSqlStateType.stsql;
												}
											}
										}
										if (efindSqlStateType != EFindSqlStateType.stsql)
										{
											this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
											efindSqlStateType = EFindSqlStateType.stnormal;
										}
									}
									else
									{
										num2--;
									}
								}
							}
						}
						break;
					case EFindSqlStateType.sttrycatch:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegintry || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegincatch)
							{
								num3++;
							}
						}
						if (efindSqlStateType == EFindSqlStateType.sttrycatch)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							if ((tsourceToken2.tokencode == 456 || tsourceToken2.tokencode == 462) && TBaseType.assigned(tsourceToken) && tsourceToken.tokencode == 313)
							{
								if (num3 == 0)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
								else
								{
									num3--;
								}
							}
						}
						break;
					case EFindSqlStateType.ststoredprocedurebody:
						if (TBaseType.assigned(tcustomSqlStatement))
						{
							ESqlStatementType sqlstatementtype = tcustomSqlStatement.sqlstatementtype;
							if (sqlstatementtype <= ESqlStatementType.sstinformixAlterProcedure)
							{
								if (sqlstatementtype != ESqlStatementType.sstmssqlgo)
								{
									if (sqlstatementtype == ESqlStatementType.sstinformixAlterFunction || sqlstatementtype == ESqlStatementType.sstinformixAlterProcedure)
									{
										goto IL_C99;
									}
								}
								else
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
							}
							else if (sqlstatementtype == ESqlStatementType.sstinformixCreateFunction || sqlstatementtype == ESqlStatementType.sstinformixCreateProcedure || sqlstatementtype == ESqlStatementType.sstinformixCreateTrigger)
							{
								goto IL_C99;
							}
							goto IL_CC1;
							IL_C99:
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							this.gcurrentsqlstatement = tcustomSqlStatement;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.ststoredprocedure;
						}
						IL_CC1:
						if (efindSqlStateType == EFindSqlStateType.ststoredprocedurebody)
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						break;
					case EFindSqlStateType.stExec:
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						break;
					}
				}
			}
			if (TBaseType.assigned(this.gcurrentsqlstatement) && efindSqlStateType != EFindSqlStateType.stnormal)
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return result;
		}

		// Token: 0x060000E3 RID: 227 RVA: 0x0000F130 File Offset: 0x0000D330
		internal virtual int domssqlgetrawsqlstatements()
		{
			int result = 0;
			int num = 0;
			if (TBaseType.assigned(this.sqlstatements))
			{
				this.sqlstatements.clear();
			}
			if (!TBaseType.assigned(this.sourcetokenlist))
			{
				return -1;
			}
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			int num2 = 0;
			int num3 = 0;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			int num4 = 0;
			bool flag = false;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (flag)
				{
					if (tsourceToken2.tokencode == 40)
					{
						num4++;
					}
					if (tsourceToken2.tokencode == 41)
					{
						num4--;
						if (num4 == 0)
						{
							flag = false;
						}
					}
					this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
				}
				else if (tsourceToken2.tokenstatus == ETokenStatus.tsignoredbygetrawstatement)
				{
					this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
				}
				else
				{
					if (tsourceToken2.tokencode == 353)
					{
						if (tsourceToken2.searchToken(40, 1) == null && tsourceToken2.searchToken(301, 1) == null)
						{
							tsourceToken2.tokencode = 264;
						}
					}
					else if (tsourceToken2.tokencode == 418)
					{
						if (tsourceToken2.nextSolidToken().tokencode == 324)
						{
							tsourceToken2.tokencode = 287;
						}
						if (tsourceToken != null && tsourceToken.tokencode == 40)
						{
							flag = true;
							num4++;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							goto IL_DAA;
						}
					}
					else if (tsourceToken2.tokencode == 558)
					{
						if (tsourceToken != null && tsourceToken.tokencode == 46)
						{
							TSourceToken tsourceToken3 = tsourceToken2.nextSolidToken();
							if (tsourceToken3 != null && tsourceToken3.tokencode == 40)
							{
								tsourceToken2.tokencode = 553;
							}
						}
					}
					else if (tsourceToken2.tokencode == 559)
					{
						if (tsourceToken != null && tsourceToken.tokencode == 46)
						{
							tsourceToken2.tokencode = 554;
						}
					}
					else if (tsourceToken2.tokencode == 560)
					{
						if (tsourceToken != null && tsourceToken.tokencode == 46)
						{
							tsourceToken2.tokencode = 555;
						}
					}
					else if (tsourceToken2.tokencode == 561)
					{
						if (tsourceToken != null && tsourceToken.tokencode == 46)
						{
							tsourceToken2.tokencode = 556;
						}
					}
					else if (tsourceToken2.tokencode == 562)
					{
						if (tsourceToken != null && tsourceToken.tokencode == 46)
						{
							tsourceToken2.tokencode = 557;
						}
					}
					else
					{
						int tokencode = tsourceToken2.tokencode;
					}
					if (efindSqlStateType == EFindSqlStateType.ststoredprocedurebody && tsourceToken2.tokencode != 463 && tsourceToken2.tokencode != 307 && tsourceToken2.tokencode != 426)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					else
					{
						TCustomSqlStatement tcustomSqlStatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						switch (efindSqlStateType)
						{
						case EFindSqlStateType.stnormal:
							if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
							{
								if (TBaseType.assigned(this.gcurrentsqlstatement))
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
								if (TBaseType.assigned(tsourceToken) && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
								{
									tsourceToken2.tokentype = ETokenType.ttsimplecomment;
									tsourceToken2.tokencode = 258;
								}
							}
							else
							{
								this.gcurrentsqlstatement = tcustomSqlStatement;
								if (TBaseType.assigned(this.gcurrentsqlstatement))
								{
									ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
									if (sqlstatementtype - ESqlStatementType.sstmssqlcreateprocedure > 5)
									{
										if (sqlstatementtype != ESqlStatementType.sstmssqlgo)
										{
											if (sqlstatementtype - ESqlStatementType.sstmssqlbegintry > 1)
											{
												this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
												efindSqlStateType = EFindSqlStateType.stsql;
											}
											else
											{
												this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
												efindSqlStateType = EFindSqlStateType.sttrycatch;
												num3 = 0;
											}
										}
										else
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
											efindSqlStateType = EFindSqlStateType.stnormal;
										}
									}
									else
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										efindSqlStateType = EFindSqlStateType.ststoredprocedure;
									}
								}
								else if (tsourceToken2.tokencode == 351)
								{
									this.gcurrentsqlstatement = new TMssqlBlock(this.dbVendor);
									this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstmssqlblock;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									efindSqlStateType = EFindSqlStateType.stblock;
								}
								else if (this.sqlstatements.size() == 0)
								{
									efindSqlStateType = EFindSqlStateType.stsql;
									this.gcurrentsqlstatement = new TMssqlExecute(this.dbVendor);
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
								else if (this.sqlstatements.get(this.sqlstatements.size() - 1).sqlstatementtype == ESqlStatementType.sstmssqlgo)
								{
									efindSqlStateType = EFindSqlStateType.stsql;
									this.gcurrentsqlstatement = new TMssqlExecute(this.dbVendor);
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
								if (!TBaseType.assigned(this.gcurrentsqlstatement))
								{
									this.errormessage = string.Concat(new string[]
									{
										"error when tokenlize:",
										tsourceToken2.astext,
										"(",
										tsourceToken2.lineNo.ToString(),
										",",
										tsourceToken2.columnNo.ToString(),
										")"
									});
									result = 1;
									tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
									efindSqlStateType = EFindSqlStateType.sterror;
									this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
									this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
							}
							break;
						case EFindSqlStateType.stsql:
							if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
							{
								bool flag2 = false;
								if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif)
								{
									TSourceToken tsourceToken4 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
									if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == 349)
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										flag2 = true;
									}
								}
								if (!flag2)
								{
									efindSqlStateType = EFindSqlStateType.stnormal;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.gcurrentsqlstatement.semicolonended = tsourceToken2;
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								}
							}
							else if (TBaseType.assigned(tcustomSqlStatement))
							{
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
								else
								{
									ESqlStatementType sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
									if (sqlstatementtype <= ESqlStatementType.sstmssqlalterqueue)
									{
										if (sqlstatementtype != ESqlStatementType.sstmssqlif)
										{
											if (sqlstatementtype != ESqlStatementType.sstmssqlalterqueue)
											{
												goto IL_AD7;
											}
											if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlexec)
											{
												this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
												break;
											}
											goto IL_AD7;
										}
									}
									else
									{
										if (sqlstatementtype == ESqlStatementType.sstmssqlcreateschema)
										{
											this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
											break;
										}
										if (sqlstatementtype != ESqlStatementType.sstmssqlwhile)
										{
											goto IL_AD7;
										}
									}
									if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegincatch || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegintry)
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										efindSqlStateType = EFindSqlStateType.stblock;
										num2 = 1;
										break;
									}
									if (this.gcurrentsqlstatement.stmtDummyTag == 1)
									{
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlif || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile)
										{
											this.gcurrentsqlstatement.stmtDummyTag = 1;
										}
										else
										{
											this.gcurrentsqlstatement.stmtDummyTag = 0;
										}
										break;
									}
									IL_AD7:
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									sqlstatementtype = this.gcurrentsqlstatement.sqlstatementtype;
									if (sqlstatementtype - ESqlStatementType.sstmssqlcreateprocedure > 5)
									{
										if (sqlstatementtype != ESqlStatementType.sstmssqlgo)
										{
											if (sqlstatementtype - ESqlStatementType.sstmssqlbegintry > 1)
											{
												efindSqlStateType = EFindSqlStateType.stsql;
											}
											else
											{
												efindSqlStateType = EFindSqlStateType.sttrycatch;
												num3 = 0;
											}
										}
										else
										{
											efindSqlStateType = EFindSqlStateType.stnormal;
										}
									}
									else
									{
										efindSqlStateType = EFindSqlStateType.ststoredprocedure;
									}
								}
							}
							else if (tsourceToken2.tokencode == 351)
							{
								if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile)
								{
									efindSqlStateType = EFindSqlStateType.stblock;
									num2 = 0;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
								else if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqldeclare)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = new TMssqlBlock(this.dbVendor);
									this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstmssqlblock;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									efindSqlStateType = EFindSqlStateType.stblock;
								}
								else
								{
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
							}
							else if (tsourceToken2.tokencode == 316)
							{
								num++;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							else if (tsourceToken2.tokencode == 313)
							{
								if (num > 0)
								{
									num--;
								}
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							else if (tsourceToken2.tokencode == 349)
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								if ((this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlwhile) && num == 0)
								{
									this.gcurrentsqlstatement.stmtDummyTag = 1;
								}
							}
							else
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							break;
						case EFindSqlStateType.ststoredprocedure:
							if (TBaseType.assigned(tcustomSqlStatement))
							{
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
								else
								{
									efindSqlStateType = EFindSqlStateType.ststoredprocedurebody;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								}
							}
							if (efindSqlStateType == EFindSqlStateType.ststoredprocedure)
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								if (tsourceToken2.tokencode == 351)
								{
									efindSqlStateType = EFindSqlStateType.stblock;
								}
							}
							break;
						case EFindSqlStateType.sterror:
							if (TBaseType.assigned(tcustomSqlStatement))
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								this.gcurrentsqlstatement = tcustomSqlStatement;
								this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
								efindSqlStateType = EFindSqlStateType.stsql;
							}
							else if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
							{
								this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							else
							{
								this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
							}
							break;
						case EFindSqlStateType.stblock:
							if (TBaseType.assigned(tcustomSqlStatement))
							{
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
							}
							if (efindSqlStateType == EFindSqlStateType.stblock)
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								if (tsourceToken2.tokencode == 351)
								{
									TSourceToken tsourceToken4 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
									if (TBaseType.assigned(tsourceToken4))
									{
										if (!TBaseType.mysametext(tsourceToken4.astext, "tran") && !TBaseType.mysametext(tsourceToken4.astext, "transaction") && !TBaseType.mysametext(tsourceToken4.astext, "distributed") && !TBaseType.mysametext(tsourceToken4.astext, "dialog") && !TBaseType.mysametext(tsourceToken4.astext, "conversation"))
										{
											num2++;
										}
									}
									else
									{
										num2++;
									}
								}
								else if (tsourceToken2.tokencode == 316)
								{
									num2++;
								}
								else if (tsourceToken2.tokencode == 313)
								{
									bool flag3 = false;
									TSourceToken tsourceToken4 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
									if (TBaseType.assigned(tsourceToken4) && tsourceToken4.tokencode == TLexerMssql.getkeywordvalue("conversation".ToUpper()))
									{
										flag3 = true;
									}
									if (!flag3)
									{
										if (num2 == 0)
										{
											if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmssqlif && TBaseType.assigned(tsourceToken4))
											{
												if (tsourceToken4.tokencode == 349)
												{
													efindSqlStateType = EFindSqlStateType.stsql;
												}
												else if (tsourceToken4.tokentype == ETokenType.ttsemicolon)
												{
													TSourceToken tsourceToken5 = this.sourcetokenlist.nextsolidtoken(tsourceToken4.posinlist, 1, false);
													if (TBaseType.assigned(tsourceToken5) && tsourceToken5.tokencode == 349)
													{
														efindSqlStateType = EFindSqlStateType.stsql;
													}
												}
											}
											if (efindSqlStateType != EFindSqlStateType.stsql)
											{
												this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
												efindSqlStateType = EFindSqlStateType.stnormal;
											}
										}
										else
										{
											num2--;
										}
									}
								}
							}
							break;
						case EFindSqlStateType.sttrycatch:
							if (TBaseType.assigned(tcustomSqlStatement))
							{
								if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlgo)
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									efindSqlStateType = EFindSqlStateType.stnormal;
								}
								else if (tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegintry || tcustomSqlStatement.sqlstatementtype == ESqlStatementType.sstmssqlbegincatch)
								{
									num3++;
								}
							}
							if (efindSqlStateType == EFindSqlStateType.sttrycatch)
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								if ((tsourceToken2.tokencode == 456 || tsourceToken2.tokencode == 462) && TBaseType.assigned(tsourceToken) && tsourceToken.tokencode == 313)
								{
									if (num3 == 0)
									{
										this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
										efindSqlStateType = EFindSqlStateType.stnormal;
									}
									else
									{
										num3--;
									}
								}
							}
							break;
						case EFindSqlStateType.ststoredprocedurebody:
							if (TBaseType.assigned(tcustomSqlStatement))
							{
								ESqlStatementType sqlstatementtype = tcustomSqlStatement.sqlstatementtype;
								if (sqlstatementtype - ESqlStatementType.sstmssqlcreateprocedure > 5)
								{
									if (sqlstatementtype == ESqlStatementType.sstmssqlgo)
									{
										this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
										this.gcurrentsqlstatement = tcustomSqlStatement;
										this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
										this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
										efindSqlStateType = EFindSqlStateType.stnormal;
									}
								}
								else
								{
									this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
									this.gcurrentsqlstatement = tcustomSqlStatement;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								}
							}
							if (efindSqlStateType == EFindSqlStateType.ststoredprocedurebody)
							{
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
							break;
						}
					}
				}
				IL_DAA:;
			}
			if (TBaseType.assigned(this.gcurrentsqlstatement) && efindSqlStateType != EFindSqlStateType.stnormal)
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return result;
		}

		// Token: 0x060000E4 RID: 228 RVA: 0x0000FF1C File Offset: 0x0000E11C
		internal virtual int domysqlgetrawsqlstatements()
		{
			int result = 0;
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			bool flag = false;
			this.userDelimiterStr = this.defaultDelimiterStr;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				TSourceToken tsourceToken = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken.tokencode == 394)
				{
					TSourceToken tsourceToken2 = tsourceToken.nextSolidToken();
					if (tsourceToken2 != null)
					{
						if (tsourceToken2.tokencode == 40)
						{
							tsourceToken.tokencode = 538;
						}
						else if (tsourceToken2.tokencode == 262)
						{
							tsourceToken.tokencode = 539;
						}
					}
				}
				else if (tsourceToken.tokencode == 393)
				{
					TSourceToken tsourceToken3 = tsourceToken.nextSolidToken();
					if (tsourceToken3 != null && tsourceToken3.tokencode == 262)
					{
						tsourceToken.tokencode = 540;
					}
				}
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken.tokencode == 258 || tsourceToken.tokencode == 257 || tsourceToken.tokencode == 259 || tsourceToken.tokencode == 260 || tsourceToken.tokentype == ETokenType.ttsemicolon)
					{
						if (TBaseType.assigned(this.gcurrentsqlstatement))
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						}
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (TBaseType.assigned(this.gcurrentsqlstatement))
						{
							ESqlStatementType[] src = new ESqlStatementType[]
							{
								ESqlStatementType.sstmysqlcreateprocedure,
								ESqlStatementType.sstmysqlcreatefunction,
								ESqlStatementType.sstmysqlcreatetrigger
							};
							if (this.includesqlstatementtype(this.gcurrentsqlstatement.sqlstatementtype, src))
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								flag = false;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken);
								this.curdelimiterchar = ';';
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken);
							}
						}
						if (!TBaseType.assigned(this.gcurrentsqlstatement))
						{
							this.errormessage = string.Concat(new string[]
							{
								"error when tokenlize:",
								tsourceToken.astext,
								"(",
								tsourceToken.lineNo.ToString(),
								",",
								tsourceToken.columnNo.ToString(),
								")"
							});
							result = 1;
							tsourceToken.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						}
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken.tokentype == ETokenType.ttsemicolon && this.gcurrentsqlstatement.sqlstatementtype != ESqlStatementType.sstmysqldelimiter)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						this.gcurrentsqlstatement.semicolonended = tsourceToken;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else if (tsourceToken.ToString().Equals(this.userDelimiterStr, StringComparison.CurrentCultureIgnoreCase))
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						tsourceToken.tokencode = 59;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						this.gcurrentsqlstatement.semicolonended = tsourceToken;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						if (tsourceToken.tokencode == 260 && this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstmysqldelimiter)
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.userDelimiterStr = "";
							for (int j = 0; j < this.gcurrentsqlstatement.sourcetokenlist.size(); j++)
							{
								TSourceToken tsourceToken4 = this.gcurrentsqlstatement.sourcetokenlist.get(j);
								if (tsourceToken4.tokencode != 536 && tsourceToken4.tokencode != 260 && tsourceToken4.tokencode != 259)
								{
									this.userDelimiterStr += tsourceToken4.ToString();
								}
							}
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (flag)
					{
						if (this.userDelimiterStr.Equals(tsourceToken.ToString(), StringComparison.CurrentCultureIgnoreCase))
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.gcurrentsqlstatement.semicolonended = tsourceToken;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							break;
						}
						if (this.userDelimiterStr.StartsWith(tsourceToken.ToString(), StringComparison.Ordinal))
						{
							string text = tsourceToken.ToString();
							for (int k = tsourceToken.posinlist + 1; k < tsourceToken.container.size(); k++)
							{
								TSourceToken tsourceToken5 = tsourceToken.container.get(k);
								if (tsourceToken5.tokencode == 536 || tsourceToken5.tokencode == 260 || tsourceToken5.tokencode == 259)
								{
									break;
								}
								text += tsourceToken5.ToString();
							}
							if (this.userDelimiterStr.Equals(text, StringComparison.CurrentCultureIgnoreCase))
							{
								for (int l = tsourceToken.posinlist; l < tsourceToken.container.size(); l++)
								{
									TSourceToken tsourceToken6 = tsourceToken.container.get(l);
									if (tsourceToken6.tokencode == 536 || tsourceToken6.tokencode == 260 || tsourceToken6.tokencode == 259)
									{
										break;
									}
									tsourceToken.tokenstatus = ETokenStatus.tsignorebyyacc;
								}
								efindSqlStateType = EFindSqlStateType.stnormal;
								this.gcurrentsqlstatement.semicolonended = tsourceToken;
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								break;
							}
						}
					}
					if (tsourceToken.tokencode == 351)
					{
						flag = true;
					}
					if (this.userDelimiterStr.Equals(";") || !flag)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						if (tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.gcurrentsqlstatement.semicolonended = tsourceToken;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					else if (tsourceToken.ToString().Equals(this.userDelimiterStr))
					{
						tsourceToken.tokenstatus = ETokenStatus.tsignorebyyacc;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						if (tsourceToken.tokentype == ETokenType.ttsemicolon && this.userDelimiterStr.Equals(";"))
						{
							TSourceToken tsourceToken7 = tsourceToken.container.nextsolidtoken(tsourceToken, -1, false);
							if (tsourceToken7 != null && tsourceToken7.tokencode == 313)
							{
								efindSqlStateType = EFindSqlStateType.stnormal;
								this.gcurrentsqlstatement.semicolonended = tsourceToken;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken);
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								break;
							}
						}
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken);
					}
					break;
				}
			}
			if (TBaseType.assigned(this.gcurrentsqlstatement) && (efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return result;
		}

		// Token: 0x060000E5 RID: 229 RVA: 0x000105A4 File Offset: 0x0000E7A4
		internal virtual int dodb2getrawsqlstatements()
		{
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			int result = 0;
			int num = 0;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				TSourceToken tsourceToken = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken.tokencode == 315 && tsourceToken.searchToken("global", 1) != null)
				{
					tsourceToken.tokencode = 535;
				}
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken.tokencode == 258 || tsourceToken.tokencode == 257 || tsourceToken.tokencode == 259 || tsourceToken.tokencode == 260 || tsourceToken.tokentype == ETokenType.ttsemicolon)
					{
						if (TBaseType.assigned(this.gcurrentsqlstatement))
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						}
					}
					else if (tsourceToken.tokencode == 273)
					{
						efindSqlStateType = EFindSqlStateType.stsqlplus;
						this.gcurrentsqlstatement = new TSqlplusCmdStatement(this.dbVendor);
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
					}
					else
					{
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (TBaseType.assigned(this.gcurrentsqlstatement))
						{
							ESqlStatementType[] src = new ESqlStatementType[]
							{
								ESqlStatementType.sstdb2declarecursor,
								ESqlStatementType.sstdb2createprocedure,
								ESqlStatementType.sstdb2createfunction,
								ESqlStatementType.sstdb2createtrigger
							};
							if (this.includesqlstatementtype(this.gcurrentsqlstatement.sqlstatementtype, src))
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								num = 1;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken);
								if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstdb2createprocedure || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstdb2createfunction || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstdb2createtrigger)
								{
									this.curdelimiterchar = ';';
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken);
							}
						}
						if (!TBaseType.assigned(this.gcurrentsqlstatement))
						{
							this.errormessage = string.Concat(new string[]
							{
								"error when tokenlize:",
								tsourceToken.astext,
								"(",
								tsourceToken.lineNo.ToString(),
								",",
								tsourceToken.columnNo.ToString(),
								")"
							});
							result = 1;
							tsourceToken.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						}
					}
					break;
				case EFindSqlStateType.stsqlplus:
					if (tsourceToken.insqlpluscmd)
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
					}
					else
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					break;
				case EFindSqlStateType.stsql:
					if (tsourceToken.tokentype == ETokenType.ttsemicolon)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						this.gcurrentsqlstatement.semicolonended = tsourceToken;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
					}
					break;
				case EFindSqlStateType.ststoredprocedure:
					if (this.curdelimiterchar != this.delimiterchar && tsourceToken.tokencode == 351)
					{
						this.curdelimiterchar = this.delimiterchar;
					}
					if (this.curdelimiterchar == ';')
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken);
						if (tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.gcurrentsqlstatement._semicolon = tsourceToken;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					else
					{
						char c;
						if (tsourceToken.astext.Length == 1)
						{
							c = tsourceToken.astext[0];
						}
						else if (tsourceToken.astext.Length > 1 && tsourceToken.issolidtoken())
						{
							c = tsourceToken.astext[tsourceToken.astext.Length - 1];
						}
						else
						{
							c = ' ';
						}
						if (c == this.curdelimiterchar)
						{
							if (tsourceToken.astext.Length > 1)
							{
								int tokencode;
								if ((tokencode = TLexerDb2.getkeywordvalue(tsourceToken.astext.Substring(0, tsourceToken.astext.Length - 1))) > 0)
								{
									tsourceToken.tokencode = tokencode;
								}
							}
							else
							{
								this.gcurrentsqlstatement._semicolon = tsourceToken;
							}
							this.gcurrentsqlstatement.addtokentolist(tsourceToken);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken);
							if (tsourceToken.tokencode == 316 || tsourceToken.tokencode == 306 || tsourceToken.tokencode == 305 || tsourceToken.tokencode == 460 || tsourceToken.tokencode == 494 || tsourceToken.tokencode == 490)
							{
								TSourceToken tsourceToken2 = tsourceToken.nextSolidToken();
								if (tsourceToken2 != null && tsourceToken2.tokencode != 59)
								{
									num++;
								}
							}
							else if (tsourceToken.tokencode == 313)
							{
								num--;
							}
							if (tsourceToken.tokentype == ETokenType.ttsemicolon && num == 0)
							{
								efindSqlStateType = EFindSqlStateType.stnormal;
								this.gcurrentsqlstatement._semicolon = tsourceToken;
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							}
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken);
					}
					break;
				}
			}
			if (TBaseType.assigned(this.gcurrentsqlstatement) && (efindSqlStateType == EFindSqlStateType.stsqlplus || efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return result;
		}

		// Token: 0x060000E6 RID: 230 RVA: 0x00010AF0 File Offset: 0x0000ECF0
		internal virtual int doteradatagetrawsqlstatements()
		{
			this.gcurrentsqlstatement = null;
			EFindSqlStateType efindSqlStateType = EFindSqlStateType.stnormal;
			TSourceToken tsourceToken = null;
			TSourceToken tsourceToken2 = null;
			int result = 0;
			bool flag = false;
			bool flag2 = false;
			int num = 0;
			for (int i = 0; i < this.sourcetokenlist.size(); i++)
			{
				if (tsourceToken2 != null && tsourceToken2.issolidtoken())
				{
					tsourceToken = tsourceToken2;
				}
				tsourceToken2 = this.sourcetokenlist.get(i);
				this.sourcetokenlist.curpos = i;
				if (tsourceToken2.tokencode != 393 && tsourceToken2.tokencode != 394 && tsourceToken2.tokencode != 395)
				{
					if (tsourceToken2.tokencode == 40)
					{
						TSourceToken tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 1, false);
						TSourceToken tsourceToken4 = this.getprevsolidtoken(tsourceToken2);
						if (tsourceToken4 != null && tsourceToken4.tokencode == 560)
						{
							tsourceToken3 = null;
						}
						if (TFunctionCall.isBuiltIn(tsourceToken4.ToString(), EDbVendor.dbvteradata) && tsourceToken4.tokencode != 313 && tsourceToken4.tokencode != 393 && tsourceToken4.tokencode != 394 && tsourceToken4.tokencode != 395 && !tsourceToken4.ToString().Equals("current_date", StringComparison.CurrentCultureIgnoreCase) && !tsourceToken4.ToString().Equals("current_time", StringComparison.CurrentCultureIgnoreCase))
						{
							tsourceToken3 = null;
						}
						if (tsourceToken3 != null)
						{
							EDataType edataType = TTypeName.searchTypeByName(tsourceToken3.ToString());
							if (edataType != EDataType.unknown_t && tsourceToken4 != null && tsourceToken4.tokencode != 559)
							{
								tsourceToken2.tokencode = 558;
								tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 2, false);
								TSourceToken tsourceToken5 = this.sourcetokenlist.nextsolidtoken(i, 3, false);
								if (tsourceToken3 != null && tsourceToken5 != null)
								{
									if (edataType <= EDataType.interval_t)
									{
										if (edataType != EDataType.char_t)
										{
											if (edataType != EDataType.date_t)
											{
												if (edataType != EDataType.interval_t)
												{
													goto IL_34B;
												}
											}
											else
											{
												if (tsourceToken4.tokencode != 262 && tsourceToken4.tokencode != 263 && tsourceToken4.tokencode != 261 && tsourceToken4.tokencode != 41 && tsourceToken4.tokencode != 561 && (tsourceToken3.tokencode != 44 || TDatatypeAttribute.searchDataTypeAttributeByName(tsourceToken5.ToString()) == EDataTypeAttribute.unknown_t))
												{
													tsourceToken2.tokencode = 40;
													goto IL_34B;
												}
												goto IL_34B;
											}
										}
										else
										{
											if (tsourceToken5.tokencode != 263)
											{
												tsourceToken2.tokencode = 40;
												goto IL_34B;
											}
											goto IL_34B;
										}
									}
									else
									{
										if (edataType == EDataType.period_t)
										{
											tsourceToken2.tokencode = 40;
											goto IL_34B;
										}
										if (edataType != EDataType.time_t && edataType != EDataType.timestamp_t)
										{
											goto IL_34B;
										}
									}
									if (tsourceToken3.tokencode == 262)
									{
										tsourceToken2.tokencode = 40;
									}
								}
							}
							else
							{
								string text = tsourceToken3.ToString();
								if (tsourceToken3.tokencode == 321 || tsourceToken3.tokencode == 285)
								{
									tsourceToken3 = this.sourcetokenlist.nextsolidtoken(i, 2, false);
									if (tsourceToken3 != null)
									{
										text = text + "_" + tsourceToken3.ToString();
									}
									else
									{
										text += "_";
									}
								}
								if (TDatatypeAttribute.searchDataTypeAttributeByName(text) != EDataTypeAttribute.unknown_t)
								{
									tsourceToken2.tokencode = 558;
								}
							}
						}
					}
					else if (tsourceToken2.tokencode == 306)
					{
						TSourceToken tsourceToken6 = tsourceToken2.searchTokenAfterObjectName();
						if (tsourceToken6 != null && tsourceToken6.tokencode == 341)
						{
							tsourceToken2.tokencode = 563;
						}
					}
				}
				IL_34B:
				switch (efindSqlStateType)
				{
				case EFindSqlStateType.stnormal:
					if (tsourceToken2.tokencode == 258 || tsourceToken2.tokencode == 257 || tsourceToken2.tokencode == 259 || tsourceToken2.tokencode == 260 || tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						if (TBaseType.assigned(this.gcurrentsqlstatement))
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
						if (tsourceToken != null && tsourceToken2.tokentype == ETokenType.ttsemicolon && tsourceToken.tokentype == ETokenType.ttsemicolon)
						{
							tsourceToken2.tokentype = ETokenType.ttsimplecomment;
							tsourceToken2.tokencode = 258;
						}
					}
					else if (tsourceToken2.tokencode == 282)
					{
						efindSqlStateType = ((TLexerTeradata)this.Flexer).cmdType(tsourceToken2.astext.Substring(1));
						if (efindSqlStateType == EFindSqlStateType.stnormal)
						{
							efindSqlStateType = EFindSqlStateType.stBTEQCmd;
						}
						this.gcurrentsqlstatement = new TTeradataBTEQCmd(this.dbVendor);
						((TTeradataBTEQCmd)this.gcurrentsqlstatement).FindSqlStateType = efindSqlStateType;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					else
					{
						if (tsourceToken2.tokencode == 46 && tsourceToken2.firstTokenOfLine())
						{
							TSourceToken tsourceToken7 = tsourceToken2.nextSolidToken();
							if (tsourceToken7 != null)
							{
								efindSqlStateType = ((TLexerTeradata)this.Flexer).cmdType(tsourceToken7.astext);
								if (efindSqlStateType != EFindSqlStateType.stnormal)
								{
									this.gcurrentsqlstatement = new TTeradataBTEQCmd(this.dbVendor);
									((TTeradataBTEQCmd)this.gcurrentsqlstatement).FindSqlStateType = efindSqlStateType;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									break;
								}
							}
						}
						else
						{
							if (tsourceToken2.tokencode == 42 && tsourceToken2.firstTokenOfLine())
							{
								efindSqlStateType = EFindSqlStateType.stBTEQCmd;
								flag = true;
								this.gcurrentsqlstatement = new TTeradataBTEQCmd(this.dbVendor);
								((TTeradataBTEQCmd)this.gcurrentsqlstatement).FindSqlStateType = efindSqlStateType;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								break;
							}
							if (tsourceToken2.tokencode == 61 && tsourceToken2.firstTokenOfLine())
							{
								TSourceToken tsourceToken8 = tsourceToken2.prevSolidToken();
								if (tsourceToken8 != null && tsourceToken8.tokencode == 59)
								{
									efindSqlStateType = EFindSqlStateType.stBTEQCmd;
									this.gcurrentsqlstatement = new TTeradataBTEQCmd(this.dbVendor);
									((TTeradataBTEQCmd)this.gcurrentsqlstatement).FindSqlStateType = efindSqlStateType;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									break;
								}
							}
							else if (tsourceToken2.firstTokenOfLine())
							{
								efindSqlStateType = ((TLexerTeradata)this.Flexer).cmdType(tsourceToken2.astext);
								if (efindSqlStateType == EFindSqlStateType.stMultiLoadCmd || efindSqlStateType == EFindSqlStateType.stFastLoadCmd || efindSqlStateType == EFindSqlStateType.stFastExportCmd)
								{
									this.gcurrentsqlstatement = new TTeradataBTEQCmd(this.dbVendor);
									((TTeradataBTEQCmd)this.gcurrentsqlstatement).FindSqlStateType = efindSqlStateType;
									this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
									break;
								}
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
						}
						this.gcurrentsqlstatement = this.sqlcmds.issql(tsourceToken2, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement);
						if (TBaseType.assigned(this.gcurrentsqlstatement))
						{
							ESqlStatementType[] src = new ESqlStatementType[]
							{
								ESqlStatementType.sstteradatacreateprocedure,
								ESqlStatementType.sstteradatacreatefunction,
								ESqlStatementType.sstteradatacreatetrigger
							};
							if (this.includesqlstatementtype(this.gcurrentsqlstatement.sqlstatementtype, src))
							{
								efindSqlStateType = EFindSqlStateType.ststoredprocedure;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
								if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstteradatacreateprocedure || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstteradatacreatefunction || this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstteradatacreatetrigger)
								{
									this.curdelimiterchar = ';';
								}
							}
							else
							{
								efindSqlStateType = EFindSqlStateType.stsql;
								this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							}
						}
						if (!TBaseType.assigned(this.gcurrentsqlstatement))
						{
							this.errormessage = string.Concat(new string[]
							{
								"error when tokenlize:",
								tsourceToken2.astext,
								"(",
								tsourceToken2.lineNo.ToString(),
								",",
								tsourceToken2.columnNo.ToString(),
								")"
							});
							result = 1;
							tsourceToken2.tokentype = ETokenType.tttokenlizererrortoken;
							efindSqlStateType = EFindSqlStateType.sterror;
							this.gcurrentsqlstatement = new TUnknownSqlStatement(this.dbVendor);
							this.gcurrentsqlstatement.sqlstatementtype = ESqlStatementType.sstinvalid;
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.stsql:
				{
					bool flag3 = true;
					if (this.gcurrentsqlstatement.sqlstatementtype == ESqlStatementType.sstteradatacreatemacro)
					{
						if (tsourceToken2.tokencode == 40 || tsourceToken2.tokencode == 558)
						{
							num++;
						}
						if (tsourceToken2.tokencode == 41)
						{
							num--;
							if (num < 0)
							{
								num = 0;
							}
						}
						flag3 = (num == 0);
					}
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon && flag3)
					{
						efindSqlStateType = EFindSqlStateType.stnormal;
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						this.gcurrentsqlstatement.semicolonended = tsourceToken2;
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
					}
					else
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					}
					break;
				}
				case EFindSqlStateType.ststoredprocedure:
					if (this.curdelimiterchar != this.delimiterchar)
					{
						if (tsourceToken2.tokencode == 351)
						{
							this.curdelimiterchar = this.delimiterchar;
						}
						else if (tsourceToken2.tokencode == 276 && tsourceToken2.container.nextsolidtoken(tsourceToken2, 1, false).tokencode == 351)
						{
							this.curdelimiterchar = this.delimiterchar;
						}
					}
					if (this.curdelimiterchar == ';')
					{
						this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
						{
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.gcurrentsqlstatement._semicolon = tsourceToken2;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
					}
					else
					{
						char c;
						if (tsourceToken2.astext.Length == 1)
						{
							c = tsourceToken2.astext[0];
						}
						else if (tsourceToken2.astext.Length > 1)
						{
							c = tsourceToken2.astext[tsourceToken2.astext.Length - 1];
						}
						else
						{
							c = ' ';
						}
						if (tsourceToken2.tokencode != 257 && c == this.curdelimiterchar)
						{
							if (tsourceToken2.astext.Length > 1)
							{
								string text = tsourceToken2.astext.Substring(0, tsourceToken2.astext.Length - 1);
								int tokencode;
								if ((tokencode = TLexerTeradata.getkeywordvalue(text)) > 0)
								{
									tsourceToken2.tokencode = tokencode;
								}
							}
							else
							{
								this.gcurrentsqlstatement._semicolon = tsourceToken2;
							}
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
							efindSqlStateType = EFindSqlStateType.stnormal;
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						}
						else
						{
							this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
						}
					}
					break;
				case EFindSqlStateType.sterror:
					if (tsourceToken2.tokentype == ETokenType.ttsemicolon)
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else
					{
						this.gcurrentsqlstatement.sourcetokenlist.add(tsourceToken2);
					}
					break;
				case EFindSqlStateType.stBTEQCmd:
					this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					if (tsourceToken2.tokencode == 260)
					{
						if (flag2)
						{
							flag2 = false;
						}
						else
						{
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							efindSqlStateType = EFindSqlStateType.stnormal;
						}
					}
					else if (tsourceToken2.tokencode == 45 && tsourceToken2.lastTokenOfLine())
					{
						if (!flag)
						{
							flag2 = true;
						}
					}
					else if (tsourceToken2.tokencode != 259)
					{
						if (tsourceToken2.tokencode == 42)
						{
							if (flag)
							{
								flag = false;
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
							flag2 = false;
						}
						else
						{
							flag2 = false;
						}
					}
					break;
				case EFindSqlStateType.stMultiLoadCmd:
					this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					if (tsourceToken2.tokencode == 59 && tsourceToken2.lastTokenOfLine())
					{
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else if (tsourceToken2.lastTokenOfLine())
					{
						string text2 = this.gcurrentsqlstatement.sourcetokenlist.get(0).ToString();
						if (this.gcurrentsqlstatement.sourcetokenlist.size() > 1)
						{
							text2 += this.gcurrentsqlstatement.sourcetokenlist.get(1).ToString();
						}
						if (text2.ToLower().StartsWith(".if", StringComparison.Ordinal))
						{
							this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
							efindSqlStateType = EFindSqlStateType.stnormal;
						}
					}
					break;
				case EFindSqlStateType.stFastExportCmd:
					this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					if (tsourceToken2.tokencode == 59 && tsourceToken2.lastTokenOfLine())
					{
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					break;
				case EFindSqlStateType.stFastLoadCmd:
					this.gcurrentsqlstatement.addtokentolist(tsourceToken2);
					if (tsourceToken2.tokencode == 59 && tsourceToken2.lastTokenOfLine())
					{
						this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
						efindSqlStateType = EFindSqlStateType.stnormal;
					}
					else if (tsourceToken2.tokencode == 260)
					{
						TSourceToken tsourceToken9 = tsourceToken2.nextSolidToken();
						if (tsourceToken9 != null)
						{
							if (tsourceToken9.tokencode == 282)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stFastLoadCmd;
							}
							else if (tsourceToken9.tokencode == 46)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stFastLoadCmd;
							}
							else if (this.sqlcmds.issql(tsourceToken9, this.dbVendor, efindSqlStateType, this.gcurrentsqlstatement) != null)
							{
								this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
								efindSqlStateType = EFindSqlStateType.stnormal;
							}
						}
					}
					break;
				}
			}
			if (TBaseType.assigned(this.gcurrentsqlstatement) && (efindSqlStateType == EFindSqlStateType.stsql || efindSqlStateType == EFindSqlStateType.stBTEQCmd || efindSqlStateType == EFindSqlStateType.ststoredprocedure || efindSqlStateType == EFindSqlStateType.sterror))
			{
				this.doongetrawsqlstatementevent(this.gcurrentsqlstatement);
			}
			return result;
		}

		// Token: 0x060000E7 RID: 231 RVA: 0x0001177C File Offset: 0x0000F97C
		internal virtual int dogetrawsqlstatements()
		{
			this.sqlstatements.clear();
			if (this.sourcetokenlist.size() == 0)
			{
				return -1;
			}
			switch (this.dbVendor)
			{
			case EDbVendor.dbvdb2:
				return this.dodb2getrawsqlstatements();
			case EDbVendor.dbvgreenplum:
				return this.dogreenplumgetrawsqlstatements();
			case EDbVendor.dbvhive:
				return this.dohivegetrawsqlstatements();
			case EDbVendor.dbvimpala:
				return this.doimpalagetrawsqlstatements();
			case EDbVendor.dbvinformix:
				return this.doinformixgetrawsqlstatements();
			case EDbVendor.dbvmdx:
				return this.domdxgetrawsqlstatements();
			case EDbVendor.dbvmysql:
				return this.domysqlgetrawsqlstatements();
			case EDbVendor.dbvmssql:
				return this.domssqlgetrawsqlstatements();
			case EDbVendor.dbvnetezza:
				return this.donetezzagetrawsqlstatements();
			case EDbVendor.dbvoracle:
				return this.dooraclegetrawsqlstatements();
			case EDbVendor.dbvpostgresql:
				return this.dopostgresqlgetrawsqlstatements();
			case EDbVendor.dbvredshift:
				return this.doredshiftgetrawsqlstatements();
			case EDbVendor.dbvsybase:
				return this.dosybasegetrawsqlstatements();
			case EDbVendor.dbvteradata:
				return this.doteradatagetrawsqlstatements();
			case EDbVendor.dbvsnowflake:
				return this.dosnowflakegetrawsqlstatements();
			}
			return this.domssqlgetrawsqlstatements();
		}

		// Token: 0x060000E8 RID: 232 RVA: 0x0001186C File Offset: 0x0000FA6C
		public int getrawsqlstatements()
		{
			int num = this.readsql();
			if (num != 0)
			{
				return num;
			}
			this.dosqltexttotokenlist();
			try
			{
				if (this.finputstream != null)
				{
					this.finputstream.Close();
				}
			}
			catch (IOException)
			{
			}
			return this.dogetrawsqlstatements();
		}

		// Token: 0x060000E9 RID: 233 RVA: 0x000118BC File Offset: 0x0000FABC
		public void tokenizeSqltext()
		{
			this.readsql();
			this.dosqltexttotokenlist();
			try
			{
				if (this.finputstream != null)
				{
					this.finputstream.Close();
				}
			}
			catch (IOException)
			{
			}
		}

		// Token: 0x060000EA RID: 234 RVA: 0x00011900 File Offset: 0x0000FB00
		internal virtual void findAllSyntaxErrorsInPlsql(TCustomSqlStatement psql)
		{
			if (psql.ErrorCount > 0)
			{
				this.copyerrormsg(psql);
			}
			for (int i = 0; i < psql.Statements.size(); i++)
			{
				this.findAllSyntaxErrorsInPlsql(psql.Statements.get(i));
			}
		}

		// Token: 0x060000EB RID: 235 RVA: 0x00011948 File Offset: 0x0000FB48
		internal virtual int doparse()
		{
			int num = this.getrawsqlstatements();
			if (num != 0)
			{
				return num;
			}
			for (int i = 0; i < this.sqlstatements.size(); i++)
			{
				int num2 = this.sqlstatements.get(i).parsestatement(null, false);
				if (this.sqlstatements.get(i).isoracleplsql())
				{
					TCustomSqlStatement psql = this.sqlstatements.get(i);
					this.findAllSyntaxErrorsInPlsql(psql);
				}
				if ((num2 != 0 || this.sqlstatements.get(i).ErrorCount > 0) && true && (this.sqlstatements.get(i).sqlstatementtype == ESqlStatementType.sstcreatetable || this.sqlstatements.get(i).sqlstatementtype == ESqlStatementType.sstcreateindex))
				{
					TCustomSqlStatement tcustomSqlStatement = this.sqlstatements.get(i);
					int num3 = 0;
					bool flag = false;
					bool flag2 = false;
					for (int j = 0; j < tcustomSqlStatement.sourcetokenlist.size(); j++)
					{
						TSourceToken tsourceToken = tcustomSqlStatement.sourcetokenlist.get(j);
						if (flag)
						{
							if (tsourceToken.issolidtoken() && tsourceToken.tokencode != 59)
							{
								flag2 = true;
							}
							if (tsourceToken.tokencode != 59)
							{
								tsourceToken.tokencode = 273;
							}
						}
						else
						{
							if (tsourceToken.tokencode == 41)
							{
								num3--;
								if (num3 == 0)
								{
									bool flag3 = false;
									if (tsourceToken.searchToken(341, 1) != null && tsourceToken.searchToken(40, 2) != null)
									{
										flag3 = (tsourceToken.searchToken(301, 3) != null);
									}
									if (!flag3)
									{
										flag = true;
									}
								}
							}
							if (tsourceToken.tokencode == 40)
							{
								num3++;
							}
						}
					}
					if (flag2)
					{
						tcustomSqlStatement.clearError();
						num2 = this.sqlstatements.get(i).parsestatement(null, false);
					}
				}
				if (num2 != 0 || this.sqlstatements.get(i).ErrorCount > 0)
				{
					this.copyerrormsg(this.sqlstatements.get(i));
					if (this.EnablePartialParsing && this.dbVendor == EDbVendor.dbvsybase && this.sqlstatements.get(i).sqlstatementtype == ESqlStatementType.sstmssqlcreateprocedure)
					{
						TMssqlCreateProcedure tmssqlCreateProcedure = (TMssqlCreateProcedure)this.sqlstatements.get(i);
						StringBuilder stringBuilder = new StringBuilder(1024);
						bool flag4 = false;
						for (int k = 0; k < tmssqlCreateProcedure.sourcetokenlist.size(); k++)
						{
							if (!flag4 && tmssqlCreateProcedure.sourcetokenlist.get(k).tokencode == 341)
							{
								flag4 = true;
							}
							else if (flag4)
							{
								stringBuilder.Append(tmssqlCreateProcedure.sourcetokenlist.get(k).astext);
							}
						}
						TGSharpSqlParser tGSharpSqlParser = new TGSharpSqlParser(this.dbVendor);
						tGSharpSqlParser.sqltext = stringBuilder.ToString();
						tGSharpSqlParser.parse();
						for (int l = 0; l < tGSharpSqlParser.sqlstatements.size(); l++)
						{
							tmssqlCreateProcedure.BodyStatements.add(tGSharpSqlParser.sqlstatements.get(l));
						}
					}
				}
			}
			return this.ErrorCount;
		}

		// Token: 0x060000EC RID: 236 RVA: 0x00011C38 File Offset: 0x0000FE38
		internal virtual void copyerrormsg(TCustomSqlStatement sql)
		{
			for (int i = 0; i < sql.fsyntaxerrors.Count; i++)
			{
				this.syntaxErrors.Add(new TSyntaxError((TSyntaxError)sql.fsyntaxerrors[i]));
			}
		}

		// Token: 0x060000ED RID: 237 RVA: 0x00011C7C File Offset: 0x0000FE7C
		private static string calculateLicenseKey(bool ignoreMachineId)
		{
			return null;
		}

		// Token: 0x060000EE RID: 238 RVA: 0x00011C7F File Offset: 0x0000FE7F
		private static bool validateLicense()
		{
			return 0 == 0;
		}

		// Token: 0x060000EF RID: 239 RVA: 0x00011C85 File Offset: 0x0000FE85
		private static bool check_license_time()
		{
			return false;
		}

		// Token: 0x04000DE7 RID: 3559
		internal const int stored_procedure_nested_level = 1024;

		// Token: 0x04000DE8 RID: 3560
		private string _sqltext;

		// Token: 0x04000DE9 RID: 3561
		private string _sqlfilename;

		// Token: 0x04000DEA RID: 3562
		private Stream sqlInputStream;

		// Token: 0x04000DEB RID: 3563
		private TSourceTokenList _sourcetokenlist;

		// Token: 0x04000DEC RID: 3564
		private TStatementList _sqlstatements;

		// Token: 0x04000DED RID: 3565
		private List<TSyntaxError> syntaxErrors;

		// Token: 0x04000DEE RID: 3566
		private bool enablePartialParsing;

		// Token: 0x04000DEF RID: 3567
		private static string userName;

		// Token: 0x04000DF0 RID: 3568
		private static string machineId = null;

		// Token: 0x04000DF1 RID: 3569
		private static string licenseType;

		// Token: 0x04000DF2 RID: 3570
		private static bool licenseOK = false;

		// Token: 0x04000DF3 RID: 3571
		private static string licenseMessage;

		// Token: 0x04000DF4 RID: 3572
		private EDbVendor dbVendor;

		// Token: 0x04000DF5 RID: 3573
		private string errormessage;

		// Token: 0x04000DF6 RID: 3574
		private TCustomLexer flexer;

		// Token: 0x04000DF7 RID: 3575
		internal TCustomParser fparser;

		// Token: 0x04000DF8 RID: 3576
		internal TCustomParser fplsqlparser;

		// Token: 0x04000DF9 RID: 3577
		internal StreamReader finputstream;

		// Token: 0x04000DFA RID: 3578
		internal TCustomSqlStatement gcurrentsqlstatement;

		// Token: 0x04000DFB RID: 3579
		internal TSqlCmds sqlcmds;

		// Token: 0x04000DFC RID: 3580
		internal char delimiterchar;

		// Token: 0x04000DFD RID: 3581
		internal string defaultDelimiterStr;

		// Token: 0x04000DFE RID: 3582
		private ITokenHandle tokenHandle;

		// Token: 0x04000DFF RID: 3583
		private IMetaDatabase metaDatabase;

		// Token: 0x04000E00 RID: 3584
		internal char curdelimiterchar;

		// Token: 0x04000E01 RID: 3585
		internal string userDelimiterStr = "";

		// Token: 0x04000E02 RID: 3586
		private static IDictionary<string, int> sqlpluskeywordList = new Dictionary<string, int>();

		// Token: 0x02000430 RID: 1072
		internal enum stored_procedure_status
		{
			// Token: 0x04001EAD RID: 7853
			start,
			// Token: 0x04001EAE RID: 7854
			is_as,
			// Token: 0x04001EAF RID: 7855
			body,
			// Token: 0x04001EB0 RID: 7856
			bodyend,
			// Token: 0x04001EB1 RID: 7857
			end
		}

		// Token: 0x02000431 RID: 1073
		internal enum stored_procedure_type
		{
			// Token: 0x04001EB3 RID: 7859
			function,
			// Token: 0x04001EB4 RID: 7860
			procedure,
			// Token: 0x04001EB5 RID: 7861
			package_spec,
			// Token: 0x04001EB6 RID: 7862
			package_body,
			// Token: 0x04001EB7 RID: 7863
			block_with_begin,
			// Token: 0x04001EB8 RID: 7864
			block_with_declare,
			// Token: 0x04001EB9 RID: 7865
			create_trigger,
			// Token: 0x04001EBA RID: 7866
			create_library,
			// Token: 0x04001EBB RID: 7867
			others
		}
	}
}
